Page 1 of 1

Authenticate.php!HELP!

Posted: Wed Aug 01, 2012 4:27 pm
by Syppii
Here is my problem login into to by browser-based game but nothing i printed on authenticate.php comes up! Here are my codes can someone help me!!!

Code: Select all

<?php
include 'connect.php';
session_start();

if (isset ($_POST['submit']))
{
  $player=$_POST['player'];
  $player=$_POST['password'];
  $playaer=strip_tags($player);
  $playaer=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 player");
  $result2 = mysql_fetch_array($result);
  if ($result2)
{
   $_SESSION['player']=$player;


   echo "<big> Log in in succesfully</big><br>";
   echo "<a href='battle.php'>continue";
 }
 else
 {
 echo"<big> wrong username or password.<a href='login.php>Try Again</a></big'> ";
 }
 }
?>

Re: Authenticate.php!HELP!

Posted: Wed Aug 01, 2012 5:45 pm
by OldRod
Change:

Code: Select all

$query = "select name, password from players where name='$player' and '$password'";
to:

Code: Select all

$query = "select name, password from players where name='$player' and password='$password'";
See if that helps

Re: Authenticate.php!HELP!

Posted: Wed Aug 01, 2012 9:22 pm
by Syppii
Sorry ! It did not

Re: Authenticate.php!HELP!

Posted: Wed Aug 01, 2012 9:25 pm
by OldRod

Code: Select all

$playaer=strip_tags($player);
player is spelled wrong

Re: Authenticate.php!HELP!

Posted: Wed Aug 08, 2012 4:39 pm
by Syppii
That did not do it. Please can I have more help!!! :D

Re: Authenticate.php!HELP!

Posted: Wed Aug 08, 2012 4:54 pm
by OldRod

Code: Select all

$playaer=strip_tags($password);
player is spelled wrong here too

Besides, shouldn't that be '$password' instead of '$playaer'?