Reply to Re: Passing data through multiple web pages

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация