View Single Post
Old 12-05-2012, 03:06 PM   PM User | #3
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,503
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by Oatley View Post
However, on the page I am re-directing to I also want to be able to access
echo the $_POST['name'].

Is it possible without passing the name in the URL string, or is there a way
Contrary to sunfighter, yes. Sessions.

A session is basically a bit of memory you can read and write which php automatically saves and reads from a file on the servers hard disk. It is unique to each user and identified by a cookie.

At the top of your script BEFORE any output such as html or print statements AND in every script that use the $_SESSION array:
session_start();

Then after:
$_SESSION['name'] = $_POST['name'];

Likewise to access it in your next script:
session_start();
$Name = $_SESSION['name'];

I'm not sure why sunfighter thinks this isn't possible..
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Users who have thanked tangoforce for this post:
Oatley (12-05-2012)