Re: passing vars. betn. php and javascript

From: Date: Fri, 26 Apr 2002 18:43:13 +0000
Subject: Re: passing vars. betn. php and javascript
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94780@lists.php.net to get a copy of this message
On Friday, April 26, 2002, at 02:15 PM, Pushkar Pradhan wrote:
Believe me I certainly don't want to ask a JS ques. here, I am reading tutorials on the web! I already accomplished reordering using PHP, I gave up on php since I wasn't able to pass arrays betn. pages using header().
If your arrays are not huge, why can you not simply use the GET method? $array = array('mutant', 'zombie', 'psychic'); $temp_array = array(); foreach ($array as $freak) { $temparray[] = 'freaks[]=' . $freak; } $headerstring = implode('&', $temparray); header('Location: http://www.domain.com/page.php?' . $headerstring); The above code creates a querystring that should look like freaks[]=mutant&freaks[]=zombie&freaks[]=psychic Then, in your "receiving" PHP page, just do something like foreach ($_GET['freaks'] as $freak) { print $freak; } Or whatever processing you need to do. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#94780) next »