Code: Select all
<?php
include_once 'connect.php';
include_once 'div.php';
?>
<link href="style.css" rel="stylesheet" type="text/css" />
<left><font color='2bab4c'>
User Login   Not a member?<a href=register.php>Take the pill</a>
<form method="POST" action="authenticate.php">
Username:   <input type="text" name="player" size="21"><br>
Password:   <input type="password" name="password" size="21" mask="x"></left></font>
<input type="submit" value="Login" name="submit">
Code: Select all
<?php
include_once 'connect.php';
session_start();
if (isset($_POST['submit']))
{
$player=$_POST['player'];
$password=$_POST['password'];
$player=strip_tags($player);
$password=strip_tags($password);
$password=md5($password);
$query = "select name,password from player where name='$player' and password='$password'";
$result = mysql_query($query) or die("Could not query players");
$result2 = mysql_fetch_array($result);
if ($result2)
{
$_SESSION['player']=$player;
echo "<big>Logged in successfully<br>";
echo "<a href='home.php'>Continue</a></big>";
}
else
{
echo "<big>Wrong username or password.<a href='login.php'>Try Again</a></big>";
}
}
?>