<form enctype="multipart/form-data" method="POST" action="ads.php?<?php echo $_SESSION["count"]; ?>" />
<input type="hidden" name="PHPSESSID" value="<?php echo $_SESSION["count"]; ?>" />
Name:<input type="text" name ="name" /><br />
Book:<input type="text" name ="book" /><br />
Subject:<input type="text" name ="subject" /><br />
Price (CAN):<input type="text" name ="price" /><br />
Description: <br /><textarea cols="40" rows="5" name="description">
Click to upload:<input type="file" name="pix" /><br />
<input type="submit" name="Upload" value="Upload Picture" />
I managed to get the ID to send in a link to the other page.
But on the next page, when I write:
echo "<b>Name: </b>" . $_SESSION['name'] . "<br />";
How do I retrieve the info from the URL using $_SESSION? Also how do I generate the proper text from $_SESSION using the ID from the link.
I'm open to anything you have in mind.
04-28-2013, 01:31 PM
You do not retrieve data from url with $_SESSION. In your code you have form which has a method "POST". This means that, once your form will be submitted via method you specified(POST in your case), you will be able to get post data via $_POST variables and not via $_SESSION variables.
04-28-2013, 02:17 PM
Yep, session data and form data are two separate things. All you need (normally) to do to access session data is to stick a session_start() in any page where you want to access it (before any output and before any reference to $_SESSION), while your form data will be in $_POST or $_GET as applicable (or you can use $_REQUEST in rare cases where it could be either POST or GET).