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" Quote 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) Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.