947740 Posted May 24, 2008 Share Posted May 24, 2008 I have an else if statement: else if(isset($_POST) && ($_POST['pass'] != $_POST['cpass'] || $_POST['pass'] == "" || $_POST['cpass'] == "" || $_POST['host'] == "" || $_POST['dbname'] == "")) { I want it to check if the form has been submitted, and if there are problems with the submitted data. The code posted above does not work and always posts the error message. I could do this with another if statement, but I want to know if I can do it in one statement. Help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/107029-elseif-problem/ Share on other sites More sharing options...
haku Posted May 24, 2008 Share Posted May 24, 2008 delete the statements one at a time to find out which one isn't doing what you want it to. Isolate the problem. Link to comment https://forums.phpfreaks.com/topic/107029-elseif-problem/#findComment-548682 Share on other sites More sharing options...
minidak03 Posted May 24, 2008 Share Posted May 24, 2008 Try this out else if($_POST && $_POST['pass'] != $_POST['cpass'] || $_POST['pass'] == "" || $_POST['cpass'] == "" || $_POST['host'] == "" || $_POST['dbname'] == "") { To me there was a few bugs with your statement. Link to comment https://forums.phpfreaks.com/topic/107029-elseif-problem/#findComment-548711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.