''Not able to query for password'' help!

Location of the Videos
Post Reply
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

''Not able to query for password'' help!

Post by Huezzer »

Hey, I've got some problems with my Register thing, 'cause every time I try to Register on my php thing, it says'' Not able to query for Password'', What's wrong? Anyone who knows anything about it?, Greetings Huezzer, Thanks ( I hope you know what I mean)

By the way: I've just Copied the codes from Hallsofvallhallas video's
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: ''Not able to query for password'' help!

Post by Jackolantern »

Even though you said you copied it directly, can you post your registration script? We need to make sure it is letter-for-letter, and it will also make it easier for people to have the script right here instead of having to hunt down the script elsewhere.
The indelible lord of tl;dr
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

Re: ''Not able to query for password'' help!

Post by Huezzer »

Aah Ye, sorry, Here it's

My code:

Code: Select all

<?php
include 'connect.php';

?>

<form method="post" action="reguser.php">
Type Username Here: <input type="text" name="player" size="21"><br>
Type Password Here: <input type="text" name="password" size="15"><br>
Retype password: <input type="text" name="pass2" size="15"><br>
Type E-mail address: <input type="text" name="email" size="60"><br>
<input type="submit" value="submit">
</form>
Also, Reguser:

Code: Select all

<?php
include 'connect.php';
?>

<?php
$player=$_POST['player'];
$password=$_POST['password'];
$pass2=$_POST['pass2'];
$player=strip_tags($player);
$email=$_POST['email'];
$email=strip_tags($email);

if ($email == "")
{
echo "You didn't enter a email address!<br>";
echo " <A href='register.php'>Go back</a>";
    exit;
    }
if ($password==$pass2)
{
  
  $isplayer="SELECT * from players where name='$player'";
  $isplayer2=mysql_query($isplayer) or die("Could not query players table");
  $isplayer3=mysql_fetch_array($isplayer2);
  if(!$_POST['password'] || !$_POST['pass2'])
  {
     print "You did not enter a password";
    echo " <A href='register.php'>Go back</a><br>";
    exit;
  }
  else if($isplayer3 || strlen($player)>21 || strlen($player)<1)
  {
     print "There is already a player of that name or the name you specified is over 16 letters or less than 1 letter<br>";
     echo " <A href='register.php'>Go back</a>";
    exit;
  }
  else
  {
    $isaddress="SELECT * from players where email='$Email'";
    $isaddress2=mysql_query($isaddress) or die("not able to query for password");
    $isaddress3=mysql_fetch_array($isaddress2);
    if($isaddress3)
    {
      print "There is already a player with that e-mail address<br>";
      echo " <A href='register.php'>Go back</a>";
    exit;
    }
    else
    {
        $password=md5($password);
        
$SQL = "INSERT into players(name, password, email, level, exper) VALUES ('$player','$password','$email','1','0')"; 
      mysql_query($SQL) or die("could not register");
      
      print "Thank you for registering.";
   
    }
  }
}

else
{
  print "Your password didn't match or you did not enter a password<br>";
   echo " <A href='register.php'>Go back</a>";
    exit;
}
echo "<br><A href='login.php'>Login Page</a>";
?>
Thanks, Huezzer
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: ''Not able to query for password'' help!

Post by hallsofvallhalla »

Code: Select all

$isaddress="SELECT * from players where email='$Email'";

Code: Select all

$isaddress="SELECT * from players where email='$email'";
and change could not query for password to could not query for email...
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

Re: ''Not able to query for password'' help!

Post by Huezzer »

Thanks, but still now ''could not query for Email'', ':(

I have changed the things that you wrote
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

Re: ''Not able to query for password'' help!

Post by Huezzer »

Hey again, I've now gone through some more video's and everything else works just fine, Except the register-page, my codes are linked in my other post longer up on the page, if someone know anything about it pls tell me :) Thanks

//Huezzer :D
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: ''Not able to query for password'' help!

Post by SpiritWebb »

Did you create the user, password and email tables in your database? If so, did you set these up right?
Image

Image
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: ''Not able to query for password'' help!

Post by hallsofvallhalla »

check your players table for the email field. Make sure it is all correct
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

Re: ''Not able to query for password'' help!

Post by Huezzer »

Guys, you are just soooooo @@@@@ Awesome! :D :D Thank you, now it works fine, ''Thank you for register'' :D

// Huezzer :D :!:
Huezzer
Posts: 72
Joined: Mon Jan 31, 2011 7:47 pm

woot? :D

Post by Huezzer »

Got one more problem when I try to log in (I do it the right way) it doesn't go forward when I try log in, it's just search for authenticate.php then it stop searching and the page it just white..., :(, I've tried for a very long time now to fix it but I've no clue :P(I can log in but then the page is white after a while searching for it), Thanks

//Huezzer :)
Post Reply

Return to “Older Browser MMO Videos”