Notice: Undefined index: error in script
Posted by Chris_Isaac (Chris Isaac), 16 January 2006Hi
I've got the following script, which does do what its supposed to:
Question I got is when I first run the script I come up with the following error, its fine after that, just happens the first time it runs:
I can understand its lookign for varibles that don't exist yet, but how do I overcome it?
Posted by admin (Graham Ellis), 16 January 2006If you start your script with
it will turn off all notices, warnings, errors are parse problems (and a host of other things) from being reported. That might be a bit too much of a change; to turn notices off but leave everything else unchanged, use
$ebits = ini_get('error_reporting');
error_reporting($ebits ^ E_NOTICE);
More about error reporting
Posted by Chris_Isaac (Chris Isaac), 16 January 2006That did it.
I also noticed that as standard :
Should be in the php.ini file, it wasn't so thats now been added for future scripts.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho