Re: how does list get passed thru' sessions
| From: | (Richard Lynch) | Date: | Wed, 06 Sep 2000 05:30:02 +0000 |
| Subject: | Re: how does list get passed thru' sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15444@lists.php.net to get a copy of this message | ||
In article
<79FE2AD687E9D311916C00D0B72CE4761C0F22@villaex1.villamontage.com>,
Stsui@villamontage.com (Sonia Tsui) wrote:
> I make the script remembering the values from the previous session by:
> <a href="index.php?button=back&start=<?php echo("$start");
> ?>&end=<?php
> echo("$end");"></a>
>
> My first question is:
> how do I pass an array using this method?
$url = "index.php?button=back&start=$start&end=$end";
reset($array);
while (list($key, $value) = each($array)){
$url .= "&array[$key]=" . urlEncode($value);
}
The "trick" is to use a variable with [$key] as part of the "name" so PHP
will then make it an array.
> My second question is:
> without using session provided by PHP, is there any way of doing it without
> the name and value pair show up on the browser?
> I know form with hidden variable should do it, but then how is it possible
> to submit a form without submit button?
You can use JavaScript (if you are willing to rely on users having
JavaScript) to submit the form from a link or just about anywhere, or use
a <INPUT TYPE=IMAGE...> to have a graphical button.
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)