Click here to Skip to main content
14,838,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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:


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.
redisplayForm($Name, $Password, $Password1, $Email);}
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)) {
$retval = ""; }
else { // Only clean up the input if it isn't empty
$retval = trim($data);
$retval = stripslashes($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" />


$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)";


Updated 20-Dec-20 20:04pm

1 solution

This is not going to work. Just to mention a few:
1. incomplete pairing of php tags
2. incomplete function eg.
function redisplayForm($name, $password, $password1, $email) {

3. sql statements come out of no where.
4. ....

I suggest you help yourself to some tutorials. The following links should give you a good head start:
Learn HTML[^]
Learn PHP+MySQL[^]
After the learning, you should be able to rewrite this code yourself.
If you encounter any problems with your learning or coding, then come here to post your question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900