How can you pass variables from one php script page to another?

Here's an example of how you use session variables: script1. Php: script2. Php: Note that this will by default use cookie-based session management.

Typical answers would be: * In the querystring (GET) * Via a POST in hidden fields * In a cookie / session variable * By including the next page in the current page (thus making both pages the same page) * By saving to a DB or file * Via JS in a hidden frame, or iframe I know some of these answers you requested not to include, but I was trying to be comprehensive. :).

The best way would be with cookies because sessions sometimes have problems. Cookies, as much as I hate them sometimes, have proven to be the best way to maintain state (which is a fancy way of saying save variables). Cookies can also be set to different durations such as "until browser closes" or "forever" as well as time values like 30 minutes or 180 days.

The longer values are often used for login info on sites. Go with cookies, they are universal and if you ever change technologies, they will still be there in the new platform.

If you pass the one value one page to another without GET/POST Step 1: Using session value get the previous page value. Step 2: Using cookie also get the previous page value. The ways are using get the previous page values.

I'd guess that a cookie would be the best solution. However, without knowing exactly why you can't use POST (and presumably GET), it's difficult to have a clear view of the problem.

Zend framework has a useful session management component that can help with this.

Create a file, save the data in the file, open the file in the other script, and extract the data.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions