Jump to content

Session Variable Forgets Part of Itself?!?!?!


signature16

Recommended Posts

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]

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.