Jump to content

i entered the wrong pass and user but it still directed me to the form action


dean012

Recommended Posts


<!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">
<form method='post' action='homepage.php'>
<table width='400' border='5' align='CENTER'>
<tr>
<td><h1>lOGIN</h1></td>
</tr>
<tr>


<tr>
<td>Password:</td>
<td><input type='password' name='pass'/></td>
</tr>
<tr>
<td>Email:</td>
<td><input type='text' name='email'/></td>
</tr>
<tr>
<td><input type='submit' name='login' value='login'/></td>

</tr>

</table>
</form>
<center><font color='white' size '5'>Not yet registered?
</font><a href='registration.php'>Sign Up Here</a>
</font>
</body>
</html>

<?php
$connect=mysql_connect("localhost","root","");
$db_selected = mysql_select_db("users_db", $connect);
if(isset($_POST['login'])){

$users_pass = $_POST['pass'];
$users_email = $_POST['email'];

$check_users = "select *from users where
users_pass='$password' AND users_email='$email'";



if(mysql_num_rows($run)>0){

echo"<script>window.open('homepage.php', '_self')</script>"; exit();
}
else {
echo"<script>alert('Email or password is incorrect!')</script>";
}
}

?>



 

$users_pass = $_POST['pass'];

$users_email = $_POST['email'];
    
    $check_users
= "select * from users where
    users_pass='$password' AND users_email='$email'"
;

 

 

You also need to execute the query. All you have done is define a string value;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.