Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP/SQL
#11
Does it output anything?
Reply
#12
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/roperson/public_html/Account/cookie.php on line 11
[This part is made by the sError() function]
Error
Incorrect username/password
I'm going do a mysql_error() to check it.
OMG!

I failded so epicly.

It's because I forgot to select the database!
Reply
#13
Lol,

well I'm glad you fixed it.
Reply
#14
It's not fixed throu.

I'm pretty sure I'm doing everything right, I' create a test.
Yep, I created an account "t" with the pass of "t" and it says "Incorrect"
Reply
#15
Can I see the registration code?
Reply
#16
Code:
$ip=$_REQUEST['ip'];
$psw=$_REQUEST['psw'];
$user=$_REQUEST['user'];

echo "Creating account...<br>";
echo "
<b>Log:</b>
<br>IP: $ip<br>Password: $psw<br>Username: $user<br>Rank: User<br>
<hr>
";


$con = mysql_connect("*","*","*");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  
  echo "Connected to database<br>Inserting data...<br>";
  
  
  mysql_select_db("roperson_data", $con);

$sql="INSERT INTO User (Username, Password, Rank, IP)
VALUES
('$user', '$psw', 'User', '$ip')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "Account created.<br>";

mysql_close($con)
Reply
#17
You have to hash the password the same way it is hashed in the login script.
Reply
#18
I never got into hashing...
Reply
#19
Well,

then don't hash the password in the login script.
Reply
#20
I think I can, based on your hashing.

*Testing*
IT WORKS!

thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)