wrathican Posted July 23, 2007 Share Posted July 23, 2007 hi. i have my form and what i want to happen is when ALL the values are not empty i want to process the form but if just one of the values is empty i want top redisplay the form i have 15 values in my form, i know thats quite a lot but i need them all so how would i do this? E.g: if(!empty($_POST['value1'],$_POST['value2']) { processform(); }else{ //redisplay the form } i have tried this and i get this error: Parse error: syntax error, unexpected ',', expecting ')' in F:\wamp\www\test\index.php on line 68 line 68 is the begining of the IF statement Link to comment https://forums.phpfreaks.com/topic/61356-solved-if-statement-and-empty/ Share on other sites More sharing options...
LiamProductions Posted July 23, 2007 Share Posted July 23, 2007 if(!empty($_POST['value1']($_POST['value2']) { processform(); }else{ //redisplay the form } I don't if that works but you could always give it a ago Link to comment https://forums.phpfreaks.com/topic/61356-solved-if-statement-and-empty/#findComment-305327 Share on other sites More sharing options...
GingerRobot Posted July 23, 2007 Share Posted July 23, 2007 <?php if(!empty($_POST['value1']) && !empty($_POST['value2'])){ //value 1 and value 2 are both non empty }else{ //one or both of value 1 and 2 are empty } ?> Link to comment https://forums.phpfreaks.com/topic/61356-solved-if-statement-and-empty/#findComment-305328 Share on other sites More sharing options...
wrathican Posted July 23, 2007 Author Share Posted July 23, 2007 hey thanks for the replies. the way i got it work was by using the suggestion provided by GingerRobot. Thanks alot Link to comment https://forums.phpfreaks.com/topic/61356-solved-if-statement-and-empty/#findComment-305334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.