Browser MMO Video #5
Re: Video#5
OOh just something, i now use Netbeans because its a lot easier to find these kind of errors
Regards,
NDest
			
			
									
						
										
						Regards,
NDest
Re: Video#5
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?
			
			
									
						
							
- PaxBritannia
- Posts: 680
- Joined: Sun Apr 18, 2010 1:54 pm
Re: Video#5
Hi n04h and welcome to indie-resource!   
 
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.
			
			
									
						
										
						 
 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.
Re: Video#5
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.
			
			
									
						
							
Re: Video#5
Login:
Authenticate:
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
			
			
									
						
							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">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>";
  }
}
?>
- PaxBritannia
- Posts: 680
- Joined: Sun Apr 18, 2010 1:54 pm
Re: Video#5
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.
			
			
									
						
										
						When you try and login to phpMyAdmin with the username and password in your connect.php, does it work?
pax.
Re: Video#5
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?
			
			
									
						
							
- PaxBritannia
- Posts: 680
- Joined: Sun Apr 18, 2010 1:54 pm
Re: Video#5
Have you tried to create another mysql account and see if loggin in from that works?
pax.
			
			
									
						
										
						pax.
Re: Video#5
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 . 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?
 . 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?
			
			
									
						
							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
 . 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?
 . 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?

