mega77 Posted December 16, 2007 Share Posted December 16, 2007 When I set PHP error reporting to "E_ALL" I get the following result in some parts of my code : PHP Notice: Undefined index: name How can I change this code so that this error does not happen ? if($_GET["name"]=="rupert" || $_GET["name"]=="kim"){ // do something } Link to comment https://forums.phpfreaks.com/topic/81943-solved-php-notice-undefined-index/ Share on other sites More sharing options...
corbin Posted December 16, 2007 Share Posted December 16, 2007 if(isset($_GET['name']) && ($_GET['name'] == 'rupert' || $_GET['name'] == 'kim')) Link to comment https://forums.phpfreaks.com/topic/81943-solved-php-notice-undefined-index/#findComment-416332 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.