#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    12
    Rep Power
    0
    I need to be able to take some user details on one page and then be able to put the information gathered onto another page that already contains another form that has been created by a javascript cookie program.
    Thing is i need the initial user information captured to be 'pasted' in to the final ordering page and to remain there (so that more products can be added) without the user having to re input their details again.

    I have just started with PHP and know that i can set up a form and that PHP can print the variables from the form , but how do i get those variables to remain fixed in the next form and be able to let users go to other pages within the site without losing the data?

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    In nederland
    Posts
    41
    Rep Power
    15
    <a href='http://www.xx.xx/form.php3?user=jochum'>next from</a>

    --form.php3
    <html>
    <body>
    Hallo <?echo $user;?>
    </body>
    </html>
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    4
    Rep Power
    0
    If you have a form on the next page you can use hidden fields to save the data in.

    <input type="hidden" name="user" value="<? echo $user ?>">

    This will be transparent to the viewer but still keep the variable alive for future form submittals.

    Maven
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    12
    Rep Power
    0
    Thanks for the ideas but both of these examples will not keep the user information contained within the pages if the user goes to view another page.
    Am i looking in the right direction with PHP i thought that i would be able to use a form submit that to say form2.php
    and then set the variables from the form in to a PHP cookie , but all i get is an error that the setcookie called after the header?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    Alkmaar, The Netherlands
    Posts
    123
    Rep Power
    14
    Cookies are always send in the header of a HTTP request or response. This error means that the header already has been send and that you cannot add any cookies anymore. You could try to call the cookie-function earlier in your page or store it as a session-variable instead.

    ------------------
    Good luck,
    Bas

    ------------------
    E-mail me at: b.vandermeijden@pecoma.nl

    [This message has been edited by MeijdenB (edited June 02, 2000).]

Similar Threads

  1. Avoid form resubmission when REFRESH clicked
    By rahulgup in forum ASP Programming
    Replies: 0
    Last Post: February 5th, 2004, 01:21 PM
  2. adding up in a form...
    By ricF in forum HTML Programming
    Replies: 8
    Last Post: February 5th, 2004, 08:31 AM
  3. empty form when user clicks back
    By mystang46 in forum ASP Programming
    Replies: 0
    Last Post: February 3rd, 2004, 04:23 PM
  4. HTTP Error 400: Bad Request, with basic form
    By crackwombat in forum PHP Development
    Replies: 1
    Last Post: January 23rd, 2004, 06:40 PM
  5. Multiple Cookies for user
    By Chris24 in forum HTML Programming
    Replies: 0
    Last Post: January 22nd, 2004, 09:27 AM

IMN logo majestic logo threadwatch logo seochat tools logo