Re: newbie question about variables
| From: | Philip Olson | Date: | Sun, 08 Apr 2001 21:51:56 +0000 |
| Subject: | Re: newbie question about variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47667@lists.php.net to get a copy of this message | ||
Something like the following HTML :
<a href="foo.php?var=1"><img src="img1.gif"></a>
<a href="foo.php?var=2"><img src="img2.gif"></a>
<a href="foo.php?var=3"><img src="img3.gif"></a>
And in foo.php have :
print $var; // 1 or 2 or 3
Also consider the following :
<a href="<?php echo $PHP_SELF; ?>?var=1"><img
src="img1.gif"></a>
To have it load the current page rather then foo.php.
regards,
philip
On Mon, 9 Apr 2001, Victor wrote:
> Hello,
>
> Is there any (easy) way to let a user to set the value of a
> variable by simply clicking on a hyperlink on a web page?
> I mean if I have a 3 links on a page if the user clicks on image1 to
> set a variable $var=1,if clicks on image2 to set it as
> $var=2,etc.
>
> Any suggestions (including RTFMs ;-)) are wellcome.
>
>
> Best regards,
> Victor
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>