Re: identifying clicked link?
| From: | Philip Olson | Date: | Thu, 18 Jan 2001 04:20:52 +0000 |
| Subject: | Re: identifying clicked link? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35251@lists.php.net to get a copy of this message | ||
Andrew,
Close :-)
<a href='page_two.php?id=1'>click</a>
OR to complicate matters, add multiple names/values :
<a href='page_two.php?id=1&foo=stuff&blah=shoes'>click</a>
Where on page_two.php if you had :
echo "$id $foo $blah";
Will print the following :
1 stuff shoes
Note the ? for first name=value and & for the proceeding ones. Or you may
have been trying to do :
$id = 1;
echo "<a href='page_two.php?id=$id'>click</a>";
OR can also be written as :
$id = 1;
<a href='page_two.php?id=<?php echo $id; ?>'>click</a>
And both the above will turn into :
<a href='page_two.php?id=1'>click</a>
That's the gist. Check out devshed.com for some basic php tutorials.
Also, be sure to check out :
http://www.zend.com/zend/tut/using-strings.php
For various forms of syntax with strings.
Philip
On Wed, 17 Jan 2001, andrew wrote:
> How can I pass an anchor tag attribute to a page?
> e.g. If I want to echo "1" on page_two:
>
>
> page_one.php contains:
>
> <a href="page_two.php" > <? $id="1"?>click</a>
>
>
> page_two.php contains:
>
> <? echo($id); ?>
>
> but page_two is coming up blank after a delay... what I am doing wrong?
>
>
> thanks,
> andrew
>
>
> --
> 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
>