Re: Passing variables between pages

From: Date: Fri, 19 Sep 2008 16:35:41 +0000
Subject: Re: Passing variables between pages
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-280525@lists.php.net to get a copy of this message
At 12:22 PM -0400 9/19/08, Jason Pruim wrote:
So if I'm understanding you right... You're suggesting that in my timecard app which has index.php (user login) and timecard.php (Actual time card app) I could simply load index.php and then on submit have it do this: ob_clean; include("timecard.php"); exit(); Putting that in a function, or a separate file... And then I have my variable intact and I still get to the second page without having to use sessions? Very interesting... This is something that I will have to play with more later...
Yes, that's exactly right. You can go from script, to script, to script without ever using sessions -- everything remains in memory as if it's one large script. Of course, you still have to respect the scope of variables, such as being required to provide them to functions -- but all variables and arrays (even POST, GET and SESSION) will still have all their contents intact. It's interesting that another topic (i.e. [PHP] SESSIONS vs. MySQL) is discussing the differences in storing variables in SESSIONS as compared to storing them in MySQL when using this technique would not require either. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#280525) next »