Jump to content

Anyone see why this script isn't stoping submit?


horseatingweeds

Recommended Posts

<?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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.