sstangle73 Posted July 30, 2007 Share Posted July 30, 2007 i have a comment form on my site and is there a way so that php wont send a blank comment form if someone goes to mail.php its useing _post so when you go to mail.php w/o fillin out the form it sumbits as blank Quote Link to comment Share on other sites More sharing options...
Fadion Posted July 30, 2007 Share Posted July 30, 2007 you can validate it using javascript to check if the form is blank, or server side in mail.php if(strlen($_POST['text']) < 1){ echo 'Please fill in the form'; } else{ ...... } Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 30, 2007 Share Posted July 30, 2007 I usually use something like empty(trim($_POST["whatever"])) so they can't just hit the spacebar to trick it. Quote Link to comment Share on other sites More sharing options...
sstangle73 Posted July 30, 2007 Author Share Posted July 30, 2007 thanks guys! 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.