Я делаю сценарий входа и получаю эту ошибку
Ошибка разбора: синтаксическая ошибка, неожиданная
T_ELSE в
/Users/Sites/website/login.php на
линия 59
и вот мой код:
<?php
if(isset($_POST['submitted'])) {
if(!empty($_POST['email'])) {
$email = mysql_real_escape_string($_POST['email']);
} else {
$email = false;
echo "<p class='error'>You forgot to enter your email address.</p>";
}
if(!empty($_POST['password'])) {
$password = mysql_real_escape_string($_POST['password']);
} else {
$email = false;
echo "<p class='error'>You forgot to enter your password.</p>";
}
if($email && $password){
$query = "SELECT * FROM `users` WHERE email='$email' AND pass=SHA1('$password') AND active='0'";
$result= mysql_query ($query, $link) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error($link));
while ($row = mysql_fetch_array($result)){
$id = $row['id'];
$bizid = $row['biz_id'];
$firstname = $row['first_name'];
$lastname = $row['last_name'];
$email = $row['email'];
$pass = $row['pass'];
$date_joined = $row['registration_date'];
$address = $row['address'];
$phone = $row['phone'];
$_SESSION['auth']=1;
$_SESSION['id'] = $id;
$_SESSION['bizid'] = $bizid;
$_SESSION['firstname'] = $firstname;
$_SESSION['lastname'] = $lastname;
$_SESSION['email'] = $email;
$_SESSION['date_joined'] = $date_joined;
$_SESSION['address'] = $address;
$_SESSION['phone'] = $phone;
header("Location: profile.php");
exit();
} else{
echo"<p class='error'>Your email or password was incorrect. Please try again.</p>";
}
}
}
mysql_close($link);
?>
<form method='post' action='./login.php'>
<label>Email Address:</label><br/><input type='text' class='normal' style='border:1px #999 solid;' name='email' />
<br/><br/><label>Password:</label><br/><input type='password' class='normal' style='border:1px #999 solid;' name='password' />
<input type='submit' class='normalbutton' value='Login' />
<p><br/><a href='forgotpassword.php'>Forgot Your Password?</a></p>
<p><br/><a href='signup.php'>Don't have an Account? Sign Up</a></p>
<input type='hidden' name='submitted' value='TRUE' />
</form>
И помощь будет принята с благодарностью. Спасибо!