
Here it's: Authenticate.php
Code: Select all
<?php
include_once 'connect.php';
session_start();
ob_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 "<br><br><br><br><br><center><big>Logged in successfully<br>";
    echo "<A href='index.php'>Continue</a></big></center>";
  
  header('refresh: 2; index.php');
  ob_end_flush();
  }
  else
  {
   echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
  }
}
?>
This was just some help for you all, Good luck with your games,
Huezzer.

