Jump to content

Undefined Index


[dx]

Recommended Posts

Hi, This could be right place for asking this. I have script which worked perfectly. And today, I updatet my Wamp Server and then back files to \www folder and then I'm getting this error.Notice: Undefined index: cookie in C:\wamp\www\settings.php on line 1010th line of settings.php is $cookie = $_COOKIE['cookie_name'];I've turned on apache module (which were off):auth_digest_moduleAnd php setting register globals,And notice is still shown.Is there some option which can hide this, and make my script works fine as before.I'm so mad on myself becouse I updated wamp.Thanks

Link to comment
Share on other sites

Ideally you would fix the PHP script. Your old setup had the error reporting set low enough where it didn't show those errors, but ideally you would fix the PHP instead of changing the settings. You get an undefined index notice when you try to access an array element that doesn't exist. e.g.:

$ar = array('index1' => 'value1');echo $ar['index1']; // print 'value1'echo $ar['index2']; // undefined index 'index2'

You can use the isset function to check if an array index is set before you try to access it.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...