This probably has to do with one/both of two things:

1. register_globals is off (not a bad thing - just requires a tidbit more
code. see http://php.net/register_globals)
2. A variable is being called before it has been initialized.

Example PHP script:

<?php
echo $a;
$a = "Hello World";
echo $a;
?>

First you will get the undefined variable message, then "Hello World" (w/o
quotes). Leaving a variable uninitialized before you use it can be a very
bad thing. If your code uses that variable to do something and it's forged
by Joe Black Cracker (i.e. http://host/page.php?var=forged"; - not hard to do
at all) you could end up getting incorrect results or worse.

What can you do about this?

1. You can ignore the errors and make the reporting of them go away. Change
your Error Reporting in php.ini to a different level (see
http://php.net/error_reporting for the levels and what they do). Restart
your web server after this change is made (unless you use PHP as CGI, but
safest just to restart it).
2. You can initialize the variables in the script before you use them.

Example of 2:

<?php
$a = "";
//php stuff here
echo $a;
?>

Good luck and have fun.

-Dash (.php)

-----Original Message-----
From: Elvin Certeza [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 12, 2002 1:52 PM
To: php
Subject: [PHP-WIN] newbie question (forms)


I have just recently installed apache and php into my system (win98).

The system test is ok....(showing php pages)

Now for the question...

I've created a form.. (rather cut and paste a form). This form works online
I have tested it myself.. but locally it gives me an error..

When my php page loads it tells me  "Notice: Undefined variable" at line
whatever.. etc..

So what I've done it tested it online to see if it's the code...(full
knowing that code works..since it's a cut out from a tutorial showing it's
samples).. and it does work..


So the question is .. is there anything missing from my local server ???



Elvin





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

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

Reply via email to