unidox Posted June 27, 2008 Share Posted June 27, 2008 I have this if statement: if (($_GET['s'] == 'news') && (in_array("news", $array))) { is there anyway that if its not in the array, I can make a var like $error. ? Thanks Quote Link to comment Share on other sites More sharing options...
Wolphie Posted June 27, 2008 Share Posted June 27, 2008 I don't really see your problem.. if(($_GET['s'] == 'news') && (in_array($_GET['s], $array)) { // successful } else { // failed } Quote Link to comment Share on other sites More sharing options...
unidox Posted June 27, 2008 Author Share Posted June 27, 2008 Well I am going to use elseif, like.... if (($_GET['s'] == 'news') && (in_array("news", $array))) { do something } elseif (($_GET['s'] == 'threads') && (in_array("news", $array))) { do something } else { echo "Sorry, this action was not able to be performed."; } I want to add an elseif ($error) { echo "You do not have access."; } 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.