Ahhh - good correction Adam, I forgot about that method :)
 
So I suppose if you already have an array and wanted to pass it in a
link/URL then you could do something like
 
foreach($array as $value) {
    $qstring .= 'array[]=' . $value . '&';
}
 
echo '<a href="link.php?' . $qstring . '">link</a>';
 
then on link.php you'd have the array $array[] (with globals) or
$_GET['array'][]
 
cool
 
Beau

-----Original Message-----
From: Adam Royle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 10 July 2002 9:05 PM
To: Beau Lebens; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] A Simple Question



Just a correction.... you can use arrays with querystrings 


page.php?var1[]=first&var1[]=second&var1[]=third 


$var1 

Array 

( 

[0] => first 

[1] => second 

[2] => third 

) 



OR 


page.php?var1[]=first&var2[2]=second&var2[]=third 


$var 1 

Array 

( 

[0] => first 

) 


$var2 

Array 

( 

[2] => second 

[3] => third 

) 


You can also have multidimensional arrays, but not associative arrays. 


But you do have the 255 character limitation (can be a bummer). 


Adam 



Also, as far as limitations go, the following are considerations; 


1. You can't pass an array using the querystring 

2. Multiline variables (ie. <textarea> contents) are bad 

3. There is a limit of 255 or something characters to a URI (someone?) 

4. Be careful with the $_GET[] array that Tony mentions, it is only 

available on more recent versions of PHP, before that it was $HTTP_GET_VARS 

and a lot of people had been using just plain $var1 or whatever, assuming 

that "register_globals" would always be ON in the php.ini file (which also 

changed in recent versions). 


HTH 


Beau 

Reply via email to