sermolux Posted August 25, 2007 Share Posted August 25, 2007 I've been writing php for a while now, and I've never come across this problem: I've been getting "Notice: Undefined index:" for $_GET and $_POST variables. I've fount away around this by using isset(): if( isset( $_GET["name"] ) ) { $name = $_GET["name"]; } else { $name = ""; } I'm also getting a notice when I use the date() function without quotes around an argument: date( i ); I don't mind making these changes... Probably better anyway, but I'm at a loss to why these notices have started to show up. I haven’t changed anything, and my php.ini file is set to not display notices. Any thoughts? Thanks. Link to comment https://forums.phpfreaks.com/topic/66608-disable-notices/ Share on other sites More sharing options...
GingerRobot Posted August 25, 2007 Share Posted August 25, 2007 Well presumably your php.ini file is set to report notices, otherwise it wouldn't be reporting them. I thought the default was changed at some point to include notices, but apparently not. Anyways, you should be using: E_ALL & ~E_NOTICE To not report notices, but still report other errors. Link to comment https://forums.phpfreaks.com/topic/66608-disable-notices/#findComment-333728 Share on other sites More sharing options...
Barand Posted August 25, 2007 Share Posted August 25, 2007 String literals should be quoted, variables should be defined and initialised, so why should you need to turn them off? Link to comment https://forums.phpfreaks.com/topic/66608-disable-notices/#findComment-333800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.