Jump to content

Archived

This topic is now archived and is closed to further replies.

OriginalSunny

Data not passing from one form to the other

Recommended Posts

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??

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

[u]removepur_mess.php[/u]
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";

Share this post


Link to post
Share on other sites
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:
[code]<?php
session_start();
$purchaseID = $_SESSION[logname'];
//
// the rest of your code
//
?>[/code]

Ken

Share this post


Link to post
Share on other sites

×

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.