Code: Select all
$password=md5($password)Code: Select all
$password=md5($password);Code: Select all
$password=md5($password)Code: Select all
$password=md5($password);Code: Select all
if (isset($_POST['Submit']))Code: Select all
if (isset($_POST['submit']))Code: Select all
<form method="POST" action="authenticate.php">
Username <input type="text" name="player" size="21"><br>
Password <input type="password" name="password" size="21">
<br>
<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 players 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='battle.php'>Continue</a></big>";
)
else
{
echo "<big>Wrong username or password. <a href='login.php'>Try Again</a></big>";
}
}
else
{
echo "no submit post variable set";
}
?>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 players where name='$player' and '$password'";
$result = mysql_query($query) or die("Could not query players");
$result2 = mysql_fetch_array($result);
if ($result2)
{
$_SESSION['player']=$player;
echo "<center><big>Logged in successfully</center><br>";
echo "<center><A href='index.php'>Continue</a></big></center>";
}
else
{
echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
}
}
?>