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. Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.