UnknownPlayer Posted September 13, 2010 Share Posted September 13, 2010 I made a form, like guestbook, and i dont wonna to write in mysql if in comment is just 1 or more spaces, no letters or numbers or chars, just space, how can i fix that? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted September 13, 2010 Share Posted September 13, 2010 You need to validate the form fields. $comment = trim($_POST['comment']); if( strlen($comment) < 5 ) { // or however many characters you want as a minimum // echo or store error message } else { // proceed } Quote Link to comment Share on other sites More sharing options...
UnknownPlayer Posted September 13, 2010 Author Share Posted September 13, 2010 Thank you. 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.