horseatingweeds Posted March 2, 2008 Share Posted March 2, 2008 <?php if ($_POST['submit']) { if (preg_match("/^([A-Z '-\.]+)$/i", $_POST['name'])) { $errors = 'Please enter a valid name.'; } if (strlen($errors) < 1) { $return = true; } else { echo $errors; $return = false; } return $return; } ?> I've even tried changing return $return to return false. I don't see ehat stupid thing I'm doing wrong. Link to comment https://forums.phpfreaks.com/topic/94057-anyone-see-why-this-script-isnt-stoping-submit/ Share on other sites More sharing options...
shocker-z Posted March 2, 2008 Share Posted March 2, 2008 should that not be greater than (>) 1 not less than(<)? if (strlen($errors) > 1) Regards Liam Link to comment https://forums.phpfreaks.com/topic/94057-anyone-see-why-this-script-isnt-stoping-submit/#findComment-481853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.