Jump to content

PHP 5.3 Varible is not defined


gocondo

Recommended Posts

This is just a warning when you switch to PHP 5.3, you'll start seeing NOTICE messages on your page if you access a variable which is not exist or initialize. For example

 

$id=($_GET["id"]);

if ($id='home)

 

If there is no value to id because it's not part of the link, you'll get an error. These kind of notice messages are not shown in PHP 5.2.

 

~ Go Condo Toronto ~

Link to comment
https://forums.phpfreaks.com/topic/220246-php-53-varible-is-not-defined/
Share on other sites

You had those errors turned OFF in 5.2, and your upgrade reverted them back to the defaults.

 

This is why the isset() function exists.

 

Also, you typed this by hand, but you're using the wrong number of equals signs in your IF check, and unnecessary parens in your $_GET access.

 

-Dan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.