How to remove the following error: Parse error: syntax error, unexpected end of file in C:\wamp\www\PROJECT\y1.php on line 67
from the following code:
<html>
<head></head>
<body>
require "y_conn.php";
extract ($_GET);
$errorCount = 0;
$Name = validateInput($_POST['name'], "Name");
$Password = validateInput($_POST['password'], "Passowrd");
$Password1= validateInput($_POST['password1'], "Confirm Passowrd");
$Email= validateInput($_POST['e-mail'], "E-mail");
if ($errorCount>0){
echo "Please re-enter the information below.
\n";
redisplayForm($Name, $Password, $Password1, $Email);}
else
echo "Thank you for filling out the form";
function displayRequired($fieldName) {
echo "The field \"$fieldName\" is required.
";
}
function validateInput($data, $fieldName) {
global $errorCount;
if (empty($data)) {
displayRequired($fieldName);
++$errorCount;
$retval = ""; }
else { // Only clean up the input if it isn't empty
$retval = trim($data);
$retval = stripslashes($retval);
}
return($retval);
}
function redisplayForm($name, $password, $password1, $email) {
?>
<form method="get" action="y1.php">
Name: | <input type="text" name="name" /> |
|
|
|
|
|
|
|
Password: | <input type="password" name="password" /> |
|
|
|
|
|
|
|
Confirm Password: | <input type="password" name="password1"> |
|
|
|
|
|
|
|
E-mail: | <input type="text" name="e-mail" /> |
|
|
|
|
|
|
|
Age: | <input type="text"name="age" /> |
|
|
|
|
|
|
|
|
|
|
|
<input type="submit" value="Done" /> | <input type="reset" value="reset" /> |
|
|
|
</form>
$q11= "SELECT * from `reg` ORDER BY `id`";
$q11_run= mysql_query($q11) or die(mysql_error());
$q12= "INSERT INTO `reg` (name,password,con. password,email,age)
VALUES ($name,$password,$password1,$e-mail,$age)";
?>
</body>
</html>