September 23rd, 1999, 11:55 PM
Is there a preferred way to pass variables between .php3 scripts? I've been using hidden form fields to pass my variables back and forth, theres got to be a better way.
September 27th, 1999, 03:23 PM
Since HTTP is stateless, without some sort of session tracking you're using the only available method.
I recommend looking into PHPLib (http://phplib.netuse.de), or considering PHP4's built in session management functions.
Your other option is to roll a bit of your own session management and use a database or flat file to save/load variables from based a cookie or session ID (but that's what PHPLib does already).
September 28th, 1999, 10:19 AM
I agree that PHPLib is the way to go.
In the interim, however, you can also use query strings as an alternative to hidden fields.
<?php echo ("<FORM ACTION='$PHP_SELF?var=" . urlencode ($var) . "'>"); ?>