Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in F:\xampp\htdocs\s.php on line 105

$
0
0

Warning: mysql_num_rows() expectsarrow-10x10.png parameter 1 to be resource, boolean given in F:\xampp\htdocs\s.php on linearrow-10x10.png 105

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta name = "description" content = "Admin Log In Section"/>
<meta name = "keywords" content = "Admin, Log In, Canoe & Kayak, Hidden Section"/> 
<title> Admin Log In </title>
<link rel = "stylesheet" type = "text/css" href = "Style.css"/>
</head>

<body>
<div id = "wrapper">
<div id = "container">
<div id = "banner">
<h1><center>
 <a href="Index.html"><img src="Images/CanoeAndKayakLogo.png" width="215" height="75" alt="Canoe & Kayak Logo" /></a>
 Wellington Canoe & Kayak - Discover Our World!
 <a href="Index.html"><img src="Images/CanoeAndKayakLogo.png" width="215" height="75" alt="Canoe & Kayak Logo" /><br></a>
 <div id="menu">
<!--Home Drop Down-->
<ul>
<li><a href="Index.html"> Home </a>
<ul>
<li><a href="Sign_Up.html"> Sign Up</a></li> 
<li><a href="Log_In.php"> Log In</a></li> 
<li><a href="Log_Out.php"> Log Out</a></li>
 

</ul><!--closure of inner Ul tag-->
</li><!--Closing the main li tag-->
</ul><!--End of ul tag-->

<!--Trips Drop Down-->
<ul>
<li><a href="Trips.html"> Trips </a>
<ul>
<li><a href="Abel_Tasman.html"> Abel Tasman</a></li> 
<li><a href="Fiordland.html"> Fiordland</a></li> 
<li><a href="Marlborough.html"> Marlborough</a></li>
<li><a href="Nelson_Lakes.html"> Nelson Lakes</a></li>  
<li><a href="Solomons.html"> Solomons</a></li>  
<li><a href="Taupo.html"> Taupo</a></li>
<li><a href="Whanganui.html"> Whanganui</a></li>  

</ul><!--closure of inner Ul tag-->
</li><!--Closing the main li tag-->
</ul><!--End of ul tag-->

<!--others Drop Down-->
<ul>
<li><a href="Others.html"> Others </a>
<ul>
<li><a href="Contact_Us.html"> Contact Us</a></li> 
<li><a href="Photos.html"> Photos</a></li>  

</ul><!--closure of inner Ul tag-->
</li><!--Closing the main li tag-->
</ul><!--End of ul tag-->
</div><!--End of main Menu-->
</center></h1>
</div>
<div id = "left">

</div>
<div id = "right">
<br/>

<!--Contents header-->
<h2>Admin Log In</h2>
<!--Introduction Paragraph-->
<p>
	<form action="Admin_Log_In.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 Coding Begins here-->
<?php
//defining Varables
$host = "localhost";
$user = "root";
$pass = "";
$db = "kayaks_club";
$admin = "wellington@canoeandkayak.co.nz";

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

//Checking to see if the user has inputed any information
if(isset ($_POST['email'])) {
	$email = $_POST['email'];
	$password = $_POST['password'];
	$sql = "SELECT * FROM users WHERE email = '".$email."' AND password = '".$password."' LIMIT 1 ";
	$res = mysql_query ($sql);
	if ((mysql_num_rows($res) == 1) and ($email == $admin)) {
		header ("Location: Admin_Index.html");
		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();
	}
}

?>
</div>
<div id ="footer">
<a href="Admin_Log_In.php"><br/>The Wellington Canoe & Kayak</a><br/>PO Box 23456<br/>Wellington<br/>Telephone:04 4776911<br/>Email: wellington@canoeandkayak.co.nz<br/>
</div>
</div>
</div>

</body>
</html>

Viewing all articles
Browse latest Browse all 13200

Trending Articles