0

Parse error: syntax error, unexpected T_IF in H:\xampp\htdocs\login.php on line 74 i don't see any mistake here?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Yakity Yak</title>
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Abel|Satisfy' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
  <p><!-- end #header --></p>
  <div id="header" class="container">
    <div id="logo">
      <h1><a href="#">Yakity Yak</a></h1>
    </div>
    <div id="menu">
      <ul>
        <li class="current_page_item"><a href="../../Documents/Unnamed Site 2/index.html">Homepage</a></li>
        <li><a href="../../Documents/Unnamed Site 2/trip.html">Destinations</a></li>
        <li><a href="#">contact </a></li>
        <li><a href="#">Login</a></li>
        <li></li>
        <li></li>
      </ul>
    </div>
  </div>
  <blockquote>
    <blockquote>
      <p> <center><img src="ewrf.jpg" width="999" height="300"  alt=""/></center>  </p>
    </blockquote>
  </blockquote>
  <div id="page">
    <div class="post">
      <h2 class="title"><a href="#">Welcome to Yakity yak club</a></h2>
            <div class="entry">
<h2>Admin Log In</h2>
<!--Introduction Paragraph-->
<p>
    <form action="login.php" method="POST">
    <table border="0.1">
<tr>
<td><label for="email">Email Address:</label></td>
<td><input type="text" id="email" name="email"/> <br/> </td>
</tr>
<tr>    
<td> <label for="password">Password:</label> </td>
<td> <input type="password" id="password:" name="password"/> <br/> </tr>
</tr>
</table>
  <input type="submit" value="Log In" name="LogIn" />
  </form> 
  <?php
//defining Varables
$host = "localhost";
$user = "root";
$pass = "";
$db = "admin";
$admin = "wellington@canoeandkayak.co.nz";

mysql_connect ($host, $user, $pass);
mysql_select_db ($db);

//Checking to see if the user has input any information
if(isset ($_POST['email'])) {
    $email = $_POST['email'];
    $password = $_POST['password'];
    $sql = "SELECT * FROM admin WHERE email = '".$email."' AND password = '".$password."' LIMIT 1 ";
    $res = mysql_query ($sql) or die(mysql_error())
    if ((mysql_num_rows($res) == 1) and ($email == $admin)) {
        header ("Location:homepage.php ");
        exit();
    } else {
        echo 'Sorry you do not have access to this part of the site. Please use the general "Log In" under the "Home" Tab.';
        exit();
    }
}

?>
<center><font color='white' size '5'>Not yet registered?
</font><a href='registration.php'>Sign Up Here</a>
</font>
</body>
</html>
4
Contributors
4
Replies
17
Views
3 Years
Discussion Span
Last Post by LastMitch
0

i done that and now eventhough i didnt put any information in when i click on login it still directed me to homepage.php

0

i done that and now eventhough i didnt put any information in when i click on login it still directed me to homepage.php

@dean.ong.14

Did you set this up correctly?

I think the reason why it redirected is on line 74:

if ((mysql_num_rows($res) == 1) and ($email == $admin)) {

Admin is you.

Does that make sense?

Since you are on local host, try close your browser and open it again then login again.

Edited by LastMitch

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.