Parse error: syntax error, unexpected $end in /home/pendkar1/public_html/login.php on line 78
This is the error i am getting for this program
I am a fresher to PHP.. i am at the learning stage..could anyone please help me out.. :
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p> </p>
<form name="Login" method="post" action="">
<p> </p>
<p> <label> LOGIN</label></p>
<p>
<label> USER NAME</label>
<input type="text" name="textfield">
</p>
<p>
<label>PASSWORD
<input type="text" name="textfield2">
</label>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</form>
<?php
$link = mysql_connect("localhost", "**", "***");
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db(pendkar1_AvitEmplyee);
?>
<?php
session_start();
$errorMessage = '';
if (isset($POST['textfield']) && isset($POST['textfield2'])) {
include 'library/config.php';
include 'library/opendb.php';
$userId = $POST['textfield'];
$password = $POST['textfield2'];
// check if the user id and password combination exist in database
$sql = "SELECT USERNAME
FROM login
WHERE USERNAME = '$userId'
AND PASSWORD = '$password';
$result = mysql_query($sql)
or die('Query failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
// the user id and password match,
// set the session
$_SESSION[db_is_logged_in] = true;
// after login we move to the main page
header('Location: Avitportal.php');
exit;
} else {
$errorMessage = 'Sorry, wrong user id / password';
}
include 'library/closedb.php';
}
?>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>