Hi again
Am Freitag, 20. Juni 2003 11:47 schrieb Thorsten Körner:
> 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'];
> ?>
Sorry I forgot the "!"-Char. So do it this way:
echo"Welcome,  " . $_GET['name'] . "!";
or
echo"Welcome,  " . $HTTP_GET_VARS['name'] . "!";
depending onyour PHP-Version.

> 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!" ;-)
Now it appears as wanted.

CU
Thorsten
-- 
Thorsten Körner         http://www.123tkShop.org

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to