Jump to content

Data not passing from one form to the other


OriginalSunny

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";
Link to comment
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
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.