signature16 Posted November 17, 2007 Share Posted November 17, 2007 This is the most frustrating thing I have experienced in a very long time. For the love of god... please somebody help me. I have three pages of code processing a PayPal order..... but my problem is with setting sessions. Index.php > Collects name and email and sends to ReviewOrder.php. <?php session_unset(); session_start(); //$paymentType = $_GET['paymentType']; $_SESSION['paymentType'] = "Sale"; ?> <html> <head> <title>Test PayPal Transaction</title> <link href="main.css" rel="stylesheet" type="text/css" /> </head> <body> <?php print_r($HTTP_POST_VARS); ?> <form action="ReviewOrder.php" method="POST"> First Name <input type="text" name="firstName" /> Last Name <input type="text" name="lastName" /> Email <input type="text" name="customerEmail" /> <input type="hidden" name="paymentType" value="<?php echo $_SESSION['paymentType'];?>" > <input type="hidden" name="paymentAmount" value="217.00" /> <input type="hidden" name="currencyCodeType" value="USD" /> <input type="submit" value="PayPal" name="submit" /> </form> </body> </html> ReviewOrder.php > This page does some random PayPal stuff. At the beginning of the page I can echo out all the sessions just fine. NO problem there. Then if the PayPal order is a success... ReviewOrder includes "GetExpressCheckoutDetails.php". At the top of the last page... I try to echo out the session variables and it doesn't return any form information. This code: [code] <?php echo $_SESSION['firstName'] ; echo $_SESSION['lastName'] ; echo $_SESSION['customerEmail'] ; echo "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><hr />"; exit; ?> Produces this output First Name: Last Name: Email: ... it just forgets about the $_POST INfo. WHATS GOING?!?!!? Please help!![/code] Quote Link to comment https://forums.phpfreaks.com/topic/77763-session-variable-forgets-part-of-itself/ Share on other sites More sharing options...
kenrbnsn Posted November 17, 2007 Share Posted November 17, 2007 I don't see where you're setting the session variables Somewhere in the script ReviewOrder.php you should have the lines: <?php if (isseet($_POST['submit'])) { $_SESSION['firstName'] = $_POST['firstName']; $_SESSION['lastName'] = $_POST['lastName']; $_SESSION['customerEmail'] = $_POST['customerEmail']; } ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/77763-session-variable-forgets-part-of-itself/#findComment-393656 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.