Re: Can't pass query string from HTML to PHP
| From: | Thorsten Körner | Date: | Fri, 20 Jun 2003 09:47:25 +0000 |
| Subject: | Re: Can't pass query string from HTML to PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152291@lists.php.net to get a copy of this message | ||
Am Freitag, 20. Juni 2003 08:06 schrieb Robby Ku:
> Hi,
>
> I've got a problem passing a query string from a HTML file to a PHP file. I
> created a HTML file called "welcome.html" with the following link:
>
> <a href="welcome.php?name=Andy"> Hi, I'm Andy </a>
>
> I am trying to pass the query string Andy to a PHP file called
> "welcome.php" with the following command:
>
> <?php echo ("Welcome, $name!"); ?>
Change this line to:
<?php
echo"Welcome, " . $_GET['name'];
?>
and that's it.
If this doesn't work, because your PHP-Version is <=4.0.6 than try this, if
you can't update:
<?php
echo"Welcome, " . $HTTP_GET_VARS['name'];
?>
For security-reasons leave your php.ini with:
register_globals=off
>
> After i load "welcome.html" in my browser, i try linking it to
> "welcome.php" through the hyperlink i created. But the result i got was
>
> "Welcome, !"
"Welcome, Andy!" ;-)
CU
Thorsten
--
Thorsten Körner http://www.123tkShop.org