#1
  1. No Profile Picture
    Terry
    Guest
    Devshed Newbie (0 - 499 posts)
    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.
  2. #2
  3. No Profile Picture
    jpenix
    Guest
    Devshed Newbie (0 - 499 posts)
    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).
  4. #3
  5. No Profile Picture
    scollo
    Guest
    Devshed Newbie (0 - 499 posts)
    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) . "'>"); ?>

Similar Threads

  1. Passing POST variables
    By rlorenzo in forum PHP Development
    Replies: 11
    Last Post: June 6th, 2004, 03:00 PM
  2. Replies: 7
    Last Post: February 16th, 2004, 03:55 PM
  3. help with assigning variables, variable passing/ retrieval
    By pinkipodmini in forum PHP Development
    Replies: 0
    Last Post: February 13th, 2004, 10:40 PM
  4. Passing javascript variables to a php function
    By umcookeg in forum JavaScript Development
    Replies: 7
    Last Post: December 18th, 2003, 03:54 PM
  5. Why variables aren't passing through the include()
    By sapien in forum PHP Development
    Replies: 7
    Last Post: November 12th, 2003, 10:35 PM

IMN logo majestic logo threadwatch logo seochat tools logo