Authenticate.php!HELP!

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
Syppii
Posts: 11
Joined: Fri Jul 27, 2012 4:59 pm

Authenticate.php!HELP!

Post 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'> ";
 }
 }
?>
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Authenticate.php!HELP!

Post 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
Syppii
Posts: 11
Joined: Fri Jul 27, 2012 4:59 pm

Re: Authenticate.php!HELP!

Post by Syppii »

Sorry ! It did not
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Authenticate.php!HELP!

Post by OldRod »

Code: Select all

$playaer=strip_tags($player);
player is spelled wrong
Syppii
Posts: 11
Joined: Fri Jul 27, 2012 4:59 pm

Re: Authenticate.php!HELP!

Post by Syppii »

That did not do it. Please can I have more help!!! :D
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: Authenticate.php!HELP!

Post by OldRod »

Code: Select all

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

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

Return to “Beginner Help and Support”