Re: PHP Notice: Undefined variable
| From: | Andrew Chernyack | Date: | Sat, 04 Oct 2003 13:16:31 +0000 |
| Subject: | Re: PHP Notice: Undefined variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165030@lists.php.net to get a copy of this message | ||
I recommend the next variant
if ($_POST["msg"] =="hi")
Why?
I've created an html file with form's action parameter as info.php that
contains phpinfo().
The result was
PHP_SELF /~adolf/info.php
_POST["a"] dv fdsvz
_SERVER["CONTENT_LENGTH"] 10
You see, _POST["a"]
----- Original Message -----
From: "nabil" <nabil.attar@aws-syria.com>
To: <php-general@lists.php.net>
Sent: Saturday, October 04, 2003 3:45 PM
Subject: [PHP] PHP Notice: Undefined variable
> I got PHP Notice: Undefined variable
>
> Should I define always any var ?? when do I have do define a var??
>
> example if I want to write
> <?php
> if ($_POST['msg'] =='hi')
> {
> do something ...
> }
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>