If you want to keep track of variable values across a number of pages, your best bet is to do it with cookies. You can set a cookie on the client side, then read the cookie as you wish and use the data retrieved on any page on the website.
Also, If you do try it either of the ways I suggested. I forgot to mention that if this is data from a text field then you'll have to make sure that there's nothing entered that will mess up your echo'd xhtml code. You could use htmlentities($yourvariable).
Using an input, each page will have to have the form submitted to the next page where the value is required. If the viewer goes to the page any other way, using the <input> won't work.
i m using cookies to pass values between multiple forms. will also give a try to sessions.the input tag had the problem that it could be used in the referenced page not in all pages.so that idea was dropped
To add to that, session variables have to be added server side, where cookies are added either on the server or on the client. If you're grabbing information from a page without it submitting, you'll have to use client-side cookies, though you can still access the values (I believe, have done this in ASP, but not tried in PHP yet) through server-side scripting.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.