/    Sign up×
Community /Pin to ProfileBookmark

Pass Values between several PHP pages

My website is a collection of 3 pages. I take some inputs in each page and calculate the result at every page. I need to display all the results only at the last page. Each of the HTML page submits to a php file where I do the computation and give a header function for the next HTML page. For example Page1 is a html page whose form is submitted to Page1Redirect.php. All computations are done in this file and then it redirects to Page2 which is again a HTML page.

I do not understand how can I pass the value only to the last page and give the header function to the next page ? Do I need to use sessions and cookies ? Could anyone give a solution ?

Thanks in advance

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NightShift58Oct 09.2007 — Sounds complicated.

You could go from one PHP page to another without resorting to a go-between HTML page. If your results are only displayed on the last page, why not do all the computations when you reach the last page?

If you decide to use PHP pages only, you would have several options for passing values from one page to the other.

Perhaps the easiest would be to use the $_POST variables obtained from the first page to populate a series of hidden input in the second page. These would be passed on to the third page - as if they had been entered on the second page - along with whatever inputs where made on Page 2.
Copy linkTweet thisAlerts:
@ruchi_bhindwaleauthorOct 09.2007 — Thanks a lot ,

It worked when I used the hidden fields as you said.

Ruchi
×

Success!

Help @ruchi_bhindwale spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...