extract( $_POST );
// determine whether phone number is valid and print
// an error message if not
if ( !@ereg( "^[0-9]{3}-[0-9]{7}$", $phone))
{
echo( "<SCRIPT LANGUAGE='JavaScript'>
window.alert('Please insert a valid phone number with (xxx-xxxxxxx) format.')
window.location.href='';
</SCRIPT>");
}
else if (!@preg_match('/^(?=.*\d{3,})(?=.*[A-Za-z]{5,})[0-9A-Za-z!@#$%]{8,32}$/', $pass))
{
echo("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Password must be at least 8 characters long and must contain at least 1 number and 1 letter')
window.location.href='';
</SCRIPT>");
}
I'm not sure what's wrong with the coding above but I can't seem to get the correct password value? It keeps displaying the same error message