PDA

View Full Version : Variable problem


jetalomar
Thu 6th Nov '03, 2:44am
does anyone know why I'm having problem with the variable.

I don't have a problem with them on a linux servers. I just started recently working on a NT server and I'm having problem with my varibles.

Let's say if I put the following code on the NT server I'll get an "Undefined variable" error

if($sport=="baseball"){}

for some reason I keep getting an error on the NT server. Is that something that has to be with the installation?

merk
Thu 6th Nov '03, 7:29am
It means that $sport has not been defined anywhere earlier in the script.

This is normal behaviour and the warning PHP generates is on by default iirc.

jetalomar
Thu 6th Nov '03, 9:41am
I didn't get this error before. What about if you are going to use the variable from a form?

merk
Thu 6th Nov '03, 10:21pm
use $_REQUEST['variable'] so your script remains safe to use with register_globals off.

To supress errors you can use the error_reporting function, you will find details of it at www.php.net/error_reporting (http://www.php.net/error_reporting)