Re: Post Array elements to URL / was: Database Search .............
| From: | Stuart Felenstein | Date: | Mon, 15 Nov 2004 08:11:23 +0000 |
| Subject: | Re: Post Array elements to URL / was: Database Search ............. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202020@lists.php.net to get a copy of this message | ||
--- Jason Wong <php-general@gremlins.biz> wrote:
> you need to build a string which looks like:
>
> Stat[1]=value1&State[2]=value2...&Stat[n]=valuen
>
> which you append to your URL like so:
>
searchresults.php?Stat[1]=value1&Stat[2]=value2...&Stat[n]=valuen
>
> This can be done using a foreach() on $_POST['Ind'],
> and implode(). Remember
> to validate each item as you go along.
Not sure if this means I need to use both a foreach
and implode or one of them.
Right now I have this :
<?php
$stats = $HTTP_POST_VARS['stats'];
if (is_array($stats))
foreach ($stats as $key=>$val ) {
print "$key = $val<br />";
}
?>
I'm wondering how I change from printing it our to
getting into the URL.
Stuart