Re: Passing variables from script to script

From: Date: Wed, 11 Dec 2002 09:06:53 +0000
Subject: Re: Passing variables from script to script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127770@lists.php.net to get a copy of this message
If they are static you could store them in another php file and include them. HTTP is stateless, meaning one person can go from one page to another or log out in between all of this. It also means there is no authentication for users, you can not prove that one person is the same person the next time he visits the page. Without using GET or POST. I would go with cookies. In fact, I would go with SESSIONS. http://www.php.net/manual/en/ref.session.php This way, only the session ID is stored as a cookie, and you can store the other variables on the server under $_SESSION['username'] and $_SESSION['password']. This may not be the perfect solution to your problem, but take a look. It's really useful. You have to run session_start(); before anything else, and it does it all via cookies(and sometimes through GET), but works very well in my experience. You may also want to look at: http://www.php.net/manual/en/function.ini-set.php to control various aspects of PHP's sessions. I've found ini_set() with sessions to be invaluable. Hope this helps! --Joseph Guhlin - http://www.josephguhlin.com/ Was I helpful? Let others know: http://svcs.affero.net/rm.php?r=bahwi

« previous php.general (#127770) next »