Thread: PHP Session

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

    Join Date
    Dec 2003
    Location
    Tennessee
    Posts
    138
    Rep Power
    11

    PHP Session


    Can someone help in general design?

    I have an HTML page with a form to make a reservation. The form action is a PHP file that processes the form information: sends an email and allows the user to pay using PayPal.

    It works OK except when the user wants to "continue shopping" from PayPal. This brings the user back to the PHP page which sends another email and loses the form information. I think I need to use a PHP session but I'm not sure where this session should begin in the page with the form or the "processing page."

    Thanks for any help!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Location
    Tennessee
    Posts
    138
    Rep Power
    11
    Originally Posted by robi1
    The following has been tested true in PHP 5.3.5.
    Setting the session variables after the execution of the script i.e. in __destruct function, will not work.
    Thanks Robi1.

    I'm not sure I understand. I have added the following to the second (processing page):

    session_start();

    and then for each variable passed from the html form page:
    $_SESSION['variablename'] = $_POST['variablename'];

    The variable shows up for the first call to the PHP processing page but disappears once the user "continues shopping" on PayPal.

IMN logo majestic logo threadwatch logo seochat tools logo