php - Using if else statement based off of $_POST value to echo message -
php - Using if else statement based off of $_POST value to echo message -
pretty sure quick , easy question have form on action post goes confirmation page. need message display on confirmation page if user selects county1 if user selects county2, county3, or county4. however, when setup statement it's not working. syntax error or 2 on part. help appreciated.
a messy thought of think should work:
<?php $county=$_post['county']; if ($county="polk") { echo "important message county"; } else { echo " "; // or nil @ } ?> but
<?php echo $_post['county'] ?> displays name of county know submission carrying through. thoughts on why above code wouldn't working? if flag syntax errors or code placement that'd much appreciated! give thanks you!
inside if status should utilize 2 equal operators instead of 1 . seek code
<?php $county = isset($_post['county'])?$_post['county']:""; if ($county == "polk") { echo "important message county"; } else { echo " "; // or nil @ } ?> php forms
Comments
Post a Comment