Re: Variables in the URL
| From: | Chris Shiflett | Date: | Thu, 22 Aug 2002 23:49:20 +0000 |
| Subject: | Re: Variables in the URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113693@lists.php.net to get a copy of this message | ||
RaNd0M wrote:
In foo.php: <? echo "<a href='bar.php?color=blue'>Blue</a>"; ?>If you only want to output static information in PHP, just do this instead: <a href="bar.php?color=blue">Blue</a>
In bar.php: <? echo "You have choosen $color"; ?> // Should print blue?This example assumes that register globals is turned on. If it is not working for you, it is likely that this is not the case for you. Try this instead: <? echo "You have chosen" . $_GET["color"]; ?> Happy hacking. Chris