Page 25 of 35
					
				Re: Video#5
				Posted: Sat Feb 05, 2011 12:43 pm
				by NDest
				OOh just something, i now use Netbeans because its a lot easier to find these kind of errors
Regards,
NDest
			 
			
					
				Re: Video#5
				Posted: Thu Feb 10, 2011 7:26 am
				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?
			 
			
					
				Re: Video#5
				Posted: Thu Feb 10, 2011 8:19 am
				by PaxBritannia
				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.
 
			
					
				Re: Video#5
				Posted: Thu Feb 10, 2011 5:53 pm
				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.
			 
			
					
				Re: Video#5
				Posted: Fri Feb 11, 2011 3:01 am
				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
 
			
					
				Re: Video#5
				Posted: Fri Feb 11, 2011 8:23 am
				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.
			 
			
					
				Re: Video#5
				Posted: Fri Feb 11, 2011 11:36 pm
				by n04h
				Actually my Database is working just fine, Here is a pic of test.php
			 
			
					
				Re: Video#5
				Posted: Sat Feb 12, 2011 12:30 am
				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?
			 
			
					
				Re: Video#5
				Posted: Sat Feb 12, 2011 6:51 am
				by PaxBritannia
				Have you tried to create another mysql account and see if loggin in from that works?
pax.
			 
			
					
				Re: Video#5
				Posted: Sat Feb 12, 2011 3:52 pm
				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 

 . 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?