Variable Problems
| From: | Dylan Williams | Date: | Fri, 06 Jun 2003 09:08:27 +0000 |
| Subject: | Variable Problems | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-20214@lists.php.net to get a copy of this message | ||
Hi all,
I'm having trouble using variables.
If I create a PHP file and define the variables within it (e.g. $name =
"Bob";) and then ask the same file to ouput the variable as part of an echo
command (e.g. echo( "Hello, $name"); ), it works fine.
The problem comes when I try to link to a PHP file from an HTML file (e.g.
<A HREF="name.php?name=Bob"> I am Bob </A>. Instead of displaying the
sentence as defined in the PHP file (e.g. echo( "Hello, $name"); ), I get
the following error message:
Notice: Undefined variable: name in e:\xxx\name.php on line 43
Does anyone know what the problem might be? I've tried writing the code in
a number of different ways but with the same result. Could it be that my
PHP or IIS server settings are not quite right?
Many thanks for any help!
Dylan.
--
Dylan J. Williams
Silent Films & Plug Music (HK) Limited
GPO Box 8315,
Central, Hong Kong SAR,
China.
Ph: +852 9641 2246 Fx; +852 2809 2550
www.silent-films.org