pleek Posted January 3, 2009 Share Posted January 3, 2009 ok so i have this function in my forum function hiliteItem($item) { $action = $_REQUEST['action']; $active = ' class="active_menu"'; if (strtolower($item) == strtolower($action)) { return $active; } elseif (strtolower($item) == "home" && $action == "") { return $active; } what it does is highlight the correct tab (the one currently being used). But sense the homepage is just index.php there is no "action" for it go get. This makes it spit out errors galore saying that "action" is undefined. Can this be edited so that if the "action" == "" it doesn't make an error? again this only a cures when the url is "index.php" Link to comment https://forums.phpfreaks.com/topic/139274-problem-with-_get-being-undefind/ Share on other sites More sharing options...
xtopolis Posted January 3, 2009 Share Posted January 3, 2009 Just assign action to whatever value you want if it's undefined. $action = (isset($_GET['action'])) ? $_GET['action'] : ''; If $_GET['action'] is set, the value is $_GET['action']'s value, otherwise it's '' (null string) Link to comment https://forums.phpfreaks.com/topic/139274-problem-with-_get-being-undefind/#findComment-728499 Share on other sites More sharing options...
pleek Posted January 3, 2009 Author Share Posted January 3, 2009 yeah!!! that fixed it, thanks a lot man. Link to comment https://forums.phpfreaks.com/topic/139274-problem-with-_get-being-undefind/#findComment-728510 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.