Browser MMO Video #5

Location of the Videos
NDest
Posts: 11
Joined: Tue Feb 01, 2011 12:43 pm

Re: Video#5

Post by NDest »

OOh just something, i now use Netbeans because its a lot easier to find these kind of errors

Regards,
NDest
NDest.
Onwer of
Image
a minecaft server
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

When I try to login I keeps saying wrong username or password and I am putting in right info, I have also tried registering more acc's but it still wont work. Can anyone help me?
Image
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

Hi n04h and welcome to indie-resource! :D

As for the problem with connecting to the database, without any error messages or code to debug, there's not much I can do to help. Sorry.

From your other post, I can tell that you're running this on a Mac, but could you tell us more about the problem?

pax.
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

I am not at my home computer at the moment but I will send you my code as soon as I get back, I think it has something to do with my login code and will post it soon.
Image
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

Login:

Code: Select all

<form method="POST" action="authenticate.php">
User Name <input tpye="text" name="player" size="21">
Password <input type="password" name="password" size="21"
<br>
<input type="submit" value="Login" name="submit">
Authenticate:

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 "<big>Logged in successfully<br>";
    echo "<A href='index.php'>Continue</a></big>";
  }
  else
  {
   echo "<big>Wrong username or password.<A href='login.php'>Try Again</a></big>";
  }
}
?>
If there is nothing wrong with these than I could show you my other code or my database but I think that the problem is with one of these
Image
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

The problem shouldn't be with your code, but with your database connection.

When you try and login to phpMyAdmin with the username and password in your connect.php, does it work?

pax.
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

Actually my Database is working just fine, Here is a pic of test.php
Image
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

Ok here is what is going on, a while back I changed the default "root" username to n04h. As I was saying before it was not letting me login so I tried to login with the username n04h and it let me in. This is good but it still wont let me login with any other user name or password. Any idea of where I should go from here?
Image
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video#5

Post by PaxBritannia »

Have you tried to create another mysql account and see if loggin in from that works?

pax.
n04h
Posts: 151
Joined: Thu Feb 10, 2011 4:48 am

Re: Video#5

Post by n04h »

Yes, n04h was that account.

Ok so I have been trying to figure this out for a bit and was just testing some ideas and I tried to login on one of the test accs I registered with the password as "root", and it worked :D . The bad thing is, now I can login with the password "root" to any of the accounts I registered on game. Any insight on this?
Image
Post Reply

Return to “Older Browser MMO Videos”