473,394 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Passing data through multiple web pages

ben
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

Sep 8 '05 #1
3 3453
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
Sep 8 '05 #2
That's what hidden fields are for. Session variables aren't very good
solution here, as the user would get strange behavior if multiple
windows are opened, or if the back button is used.

Sep 8 '05 #3
Chung Leong wrote:
That's what hidden fields are for. Session variables aren't very good
solution here, as the user would get strange behavior if multiple
windows are opened, or if the back button is used.


THAT depends on the quality of the underlying code Chung. :-)
But of course: Passing them all through hiddwen fields is another
possibility. I use it quite often actually. :-)

Regards,
Erwin Moller
Sep 8 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
2
by: Glenn | last post by:
I am an old ASP developer that has begun porting existing apps to ASP.NET. I am currently working on a wizard dialog that contains about 4 pages. In ASP in order to keep track of user entered...
2
by: Stephen Bartholomew | last post by:
Hi All, Firstly, apologies to anyone that notices the cross-post: i also posted this in microsoft.public.dotnet.general earlier this week. I have an ecommerce site that resides mainly on an...
1
by: Eric | last post by:
Hello, I am trying to come up with the best way to pass large amounts of data from page to page, namely a data table. The user needs to enter data into a form in one page and confirm it on...
3
by: Steven J. Reed | last post by:
I must be missing something, because this should be easy to do. After the user has selected several options on a page, I do a database query which returns a few records that I want to pass to...
7
by: Smokey Grindle | last post by:
For a website that has users logged into it using sessions, its it best to pass data between pages in session variables or through query strings?
10
nathj
by: nathj | last post by:
Hi, Part of one of my current projects is to provide an application form. This form needs to get quite a bit of data, so rather than have one really long form on one page I have split the data...
1
BezerkRogue
by: BezerkRogue | last post by:
I have created a page that passes a variables from the start page to a results page that allows operators to edit the data. When I click the submit button, it reruns the page load instruction from...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.