Re: Passing Variables
| From: | Beauford.2002 | Date: | Sun, 02 Feb 2003 02:42:54 +0000 |
| Subject: | Re: Passing Variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133946@lists.php.net to get a copy of this message | ||
Perfect. Thanks.
----- Original Message -----
From: "Philip Olson" <philip@cornado.com>
To: "Beauford.2002" <beauford.2002@rogers.com>
Cc: "PHP General" <php-general@lists.php.net>
Sent: Saturday, February 01, 2003 2:22 PM
Subject: Re: [PHP] Passing Variables
> On Sat, 1 Feb 2003, Beauford.2002 wrote:
>
> > Hi,
> >
> > Is there a way to pass a variable to a PHP script without using a form?
I
> > want to put several links on my main page that when clicked on goes to a
PHP
> > script - depending on what link was selected, will determine what part
of
> > the PHP script gets executed.
>
> Yes, use GET:
>
> <a href="foo.php?fruit=apple">eat an apple</a>
>
> See also if() and switch()
>
> http://www.php.net/else
> http://www.php.net/switch
> http://www.php.net/variables.external
>
> print $_GET['fruit'];
>
> Regards,
> Philip
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>