http://forums.devshed.com/php-development-5/how-long-do-variables-stay-in-the-post-array-216896.html 에서 참조

The post variables are stored in $_POST inside the HTTP headers. The page submitting the values then post them to the next pages HTTP headers, when the next page goes anywhere it no longer keeps the values and the information stored within the variables are gone.

Webpages unlike applications are known as being ‘stateless’ there’s no state between the server computer and the client computer. This means we have to come up with other means to have ‘state’ the method used is to use user sessions. You want to be interested in User Sessions as within a session you can store information in a $_SESSION variable. On each page you begin the session – this means all your PHP scripts will need to open with session_start(); – make sure it’s right at the top though as it won’t work if any outputted information has already been sent. Then you store information inside the session variables. Research sessions and session variables – or you could look at cookies (though some users do turn off cookies so this is not a fool-proof method of keeping ‘state’).

Tell me if you want more information on sessions and I’ll try to pick out some good sites. Have a try looking for some yourself first .

Hope this helps!!

Comments are closed.

Post Navigation