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 Link to comment https://forums.phpfreaks.com/topic/62497-solved-comment-forms/ 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{ ...... } Link to comment https://forums.phpfreaks.com/topic/62497-solved-comment-forms/#findComment-311066 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. Link to comment https://forums.phpfreaks.com/topic/62497-solved-comment-forms/#findComment-311129 Share on other sites More sharing options...
sstangle73 Posted July 30, 2007 Author Share Posted July 30, 2007 thanks guys! Link to comment https://forums.phpfreaks.com/topic/62497-solved-comment-forms/#findComment-311209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.