session variables across several pages

From: Date: Wed, 15 May 2002 14:48:45 +0000
Subject: session variables across several pages
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19194@lists.php.net to get a copy of this message
First, forgive me if this seems to be cross post -- but it does involve both PHP and MySQL. My client requirements are: From their website, they display a list of classes. On registering for a class, the user is sent to a secure page that is hosted on a different secured server that does not have access to the client's MySQL database. I pass in the class info so the registration form can display "Registering for class $title<br>$start_date<br>$cost" The form then gathers name, address, etc including credit card info. On submitting the form, the data is processed and a PGP email is sent out to the registar. Then a thank you page is displayed and the user is forwarded back to the main site, where a second page is displayed allowing for either download of class materials or to return to the class list. This page is where I post the necessary info into the MySQL database. So my dilemma -- I want to use session_register to capture the field info from the registration form and then read it back out on the website thank you page. I have
    session_start();
    session_register("start_date");
    session_register("end_date");
    session_register("section");
    session_register("class");
    session_register("title");
    session_register("class_id");
    session_register("register_id");
    session_register("name");
    session_register("employer");
    session_register("e_address");
    session_register("e_city");
    session_register("e_state");
    session_register("e_zip");
at the beginning of the form page (select_class.php) and the thank you page on their website (thanks.php) where I post the info to MySQL.
The form includes inputs such as
        <td><p><b>Name:</b></p></td>
        <td colspan=3>
          <input type=text name=name maxlength=100 size=60
                value="<? echo($name); ?>">
        </td>
What happens is that old data shows up for name, and address (the only fields I have tested so far) regardless of what I enter in the form. I was under the impression that a registered variable is updated once the page is processed. If I am calling the same page (select_class.php) to process the form, does the data get reverted somehow? The data just doesn't seem to get updated to the form inputs. What might I be missing? Thanks in advance Terry Romine Web Developer JumpInteractive.com

« previous php.db (#19194) next »