Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Passing data through multiple web pages
September 8, 2005, 4:45 am
rate this thread
I am developing a website using php.This website involves
dealing with forms which span over multiple pages.
I want data obtained from 1 form to be available after 3-4 pages.
cookies as last option as they r not supposed to be reliable.I want to
achieve the above task using SESSION VARIABLES.Can someone please guide
me how to use session variables?(and pass form data across several
pages using them?)
Thanking in advance,
Re: Passing data through multiple web pages
Try php.net for starters:
1) Make sure session work on your machine.
(eg: where are session stored? CHeck also php.ini for session.autostart to
make your life easier. If you have no write-access to php.ini, use
session_start() above every page)
2) on page1.php: put something in a session
$_SESSION["firstname"] = $_POST["firstname"];
3) On page23.php, retrieve it:
Good luck and be sure you read the manual at php.net. It is good and
explains a lot more than I possibly could over here.