*** PHP *** WHAT IS WRONG WITH THAT?
I can't figure out what is wrong in the line 13... Keep showing "Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in /home/creative/public_html/webguest.php on line 13
I just want validate the zip code with php instead java.
Following its my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lawn Care</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Affordable Lawn Care for everybody. Sign Up Today">
<meta name="keywords" content="lawn care+lawn service+lawn maintenance+weed">
<meta name="robots" content="INDEX, FOLLOW">
</head>
<?php
function validateZIP(field) {
if $_POST[$field] == "" {
echo "$field is empty";
return false; }
$fields = array('77070', '77373', '77380');
foreach ($fields as $zip) {
if($_POST[$field] == $zip)
return true;
}
echo "Zip code is incorrect.";
return false;
}
?>
<form action="guestip.php" method="post" name="GuestArea" id="GuestArea">
<table width="219" height="157" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="219" height="157"><table width="100%" height="144" border="0" cellpadding="0" cellspacing="0"><tr>
<td width="78" height="50">Zip Code: </td>
<td width="54"><input name="ZipCode" type="text" id="ZipCode" size="5" maxlength="5" onSubmit="return validateZIP(this.ZipCode.value)" /></td>
<td width="87"><input type="submit" name="Submit" value="Thank You" onSubmit ="return validateZIP(ZipCode)" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
I can't figure out what is wrong in the line 13... Keep showing "Parse error: syntax error, unexpected ')', expecting '&' or T_VARIABLE in /home/creative/public_html/webguest.php on line 13
I just want validate the zip code with php instead java.
Following its my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-…
<html xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lawn Care</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Affordable Lawn Care for everybody. Sign Up Today">
<meta name="keywords" content="lawn care+lawn service+lawn maintenance+weed">
<meta name="robots" content="INDEX, FOLLOW">
</head>
<?php
function validateZIP(field) {
if $_POST[$field] == "" {
echo "$field is empty";
return false; }
$fields = array('77070', '77373', '77380');
foreach ($fields as $zip) {
if($_POST[$field] == $zip)
return true;
}
echo "Zip code is incorrect.";
return false;
}
?>
<form action="guestip.php" method="post" name="GuestArea" id="GuestArea">
<table width="219" height="157" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="219" height="157"><table width="100%" height="144" border="0" cellpadding="0" cellspacing="0"><tr>
<td width="78" height="50">Zip Code: </td>
<td width="54"><input name="ZipCode" type="text" id="ZipCode" size="5" maxlength="5" onSubmit="return validateZIP(this.ZipCode.value)" /></td>
<td width="87"><input type="submit" name="Submit" value="Thank You" onSubmit ="return validateZIP(ZipCode)" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>