''Not able to query for password'' help!
''Not able to query for password'' help!
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
By the way: I've just Copied the codes from Hallsofvallhallas video's
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: ''Not able to query for password'' help!
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
Re: ''Not able to query for password'' help!
Aah Ye, sorry, Here it's
My code:
Also, Reguser:
Thanks, Huezzer
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>
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>";
?>- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: ''Not able to query for password'' help!
Code: Select all
$isaddress="SELECT * from players where email='$Email'";Code: Select all
$isaddress="SELECT * from players where email='$email'";Re: ''Not able to query for password'' help!
Thanks, but still now ''could not query for Email'', ':(
I have changed the things that you wrote
I have changed the things that you wrote
Re: ''Not able to query for password'' help!
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
//Huezzer
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: ''Not able to query for password'' help!
Did you create the user, password and email tables in your database? If so, did you set these up right?
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: ''Not able to query for password'' help!
check your players table for the email field. Make sure it is all correct
Re: ''Not able to query for password'' help!
Guys, you are just soooooo @@@@@ Awesome!
Thank you, now it works fine, ''Thank you for register'' 
// Huezzer

// Huezzer
woot? :D
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
(I can log in but then the page is white after a while searching for it), Thanks
//Huezzer
//Huezzer

