Jump to content


Photo

Data not passing from one form to the other


  • Please log in to reply
2 replies to this topic

#1 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 13 April 2006 - 07:23 PM

The code i have used to pass the purchaseID from one page to another is below. I don't understand why the purchaseID in bold (in rempur_mess.php) is not being output as the purchase is deleted??

remove_purchase.php
session_start();
...
...
$sql = "DELETE FROM Purchases where purchaseID = '$purchaseID'";
mysql_query($sql);
$_SESSION['auth']="yes";
$_SESSION['logname'] = $purchaseID;
header("Location: removepur_mess.php");
...

removepur_mess.php
session_start();
...
...
...
(connect to the database ...)
...
echo "<h2 align='center' style='margin-top: .7in'>
Your purchase for purchaseID $purchaseID has been removed from the system</h2>\n";

#2 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 13 April 2006 - 07:35 PM

You've stored in the $_SESSION array, but you don't use the value from the $_SESSION array in the second script. Try something like this:
<?php
session_start();
$purchaseID = $_SESSION[logname'];
//
// the rest of your code
//
?>

Ken

#3 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 13 April 2006 - 10:33 PM

Thanks. It worked!!!!!!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users