natasha_sharma Posted March 15, 2016 Share Posted March 15, 2016 Below code will evaluate if the post data = grade. But i want to do opposite, I want to do an action if the Post data is not Grade. if (($_POST['grade'])) How to do it? Is this the solution: if ((!$_POST['grade'])) Quote Link to comment https://forums.phpfreaks.com/topic/301008-evaluating-post-data-in-php/ Share on other sites More sharing options...
Solution Jacques1 Posted March 15, 2016 Solution Share Posted March 15, 2016 So you want to check if the grade parameter does not exist at all? if (!isset($_POST['grade'])) ... or if (!array_key_exists('grade', $_POST)) ... Quote Link to comment https://forums.phpfreaks.com/topic/301008-evaluating-post-data-in-php/#findComment-1532030 Share on other sites More sharing options...
natasha_sharma Posted March 15, 2016 Author Share Posted March 15, 2016 Thanks Jacques. Quote Link to comment https://forums.phpfreaks.com/topic/301008-evaluating-post-data-in-php/#findComment-1532031 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.