Re: passing a variable between URL's

From: Date: Wed, 16 Apr 2003 21:48:31 +0000
Subject: Re: passing a variable between URL's
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-144200@lists.php.net to get a copy of this message
At 4/15/2003 12:43 PM, Scott Thompson (My favorite Kid in the Hall!) wrote:
I have seached the docs and the only two solutions I can come up with are the use HTTP
GETS or cookies. Any other solutions?
Actually, I like to store data in hidden forms, like so: <form name="myForm" method="post"> <input type="hidden" name="username" value="bob"> <input type="hidden" name="myVariableFromLastPage" value="yellow"> </form> and use anchors like so: <a href="javascript:document.myForm.submit();">Clicky!</a> Now, that's a simplistic version, but you get the idea. I frequently use it to pass variables across multiple pages without using cookies or messy URI appends. You can also use it for server-side processing by making a function out of it: function grabNGo(thisVar) { document.myForm.myValue.value = thisVar; document.myForm.submit(); } The project I'm working on right now uses information from an Oracle database that can only be accessed through Javascript and an Oracle API. I use this method to transport data from the database to our pages all the time. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: skeller@healthtvchannel.org Web: www.healthtvchannel.org

« previous php.general (#144200) next »