|
Posted by Erwin Moller on 09/08/05 11:36
ben wrote:
> Hi guyz,
> 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.
>
> This can be ofcourse achieved through use of cookies.But i am keeping
> 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,
> bye,
> ben
Hi,
Try php.net for starters:
http://nl3.php.net/manual/en/ref.session.php
Generally speaking:
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
eg
$_SESSION["firstname"] = $_POST["firstname"];
3) On page23.php, retrieve it:
echo $_SESSION["firstname"];
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.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|