Linking the User Login Sytem to the Profile System
Re: Linking the User Login Sytem to the Profile System
Hi Temor,
I found one of our errors, the one on line 95 with the mysql, I was missing a ` after user_password.
My final issue now, at least I hope is the one of line 55 with the foreach() invalid arguement.
Although the valid credentials validation still isnt working correctly.
I found one of our errors, the one on line 95 with the mysql, I was missing a ` after user_password.
My final issue now, at least I hope is the one of line 55 with the foreach() invalid arguement.
Although the valid credentials validation still isnt working correctly.
-
- Posts: 534
- Joined: Thu May 05, 2011 8:19 pm
Re: Linking the User Login Sytem to the Profile System
do a print_r($errors)
and see what you get.
Post the output here
and see what you get.
Post the output here
I don't like to brag, but I wasn't circumcised. I was circumnavigated.
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
Re: Linking the User Login Sytem to the Profile System
Hi, where do I put print_r($errors)
on the login page?
EDIT: I got Username/Password incorrect.
EDIT: Which is the same as what I got when I tried to create the userlogin system a second time.
on the login page?
EDIT: I got Username/Password incorrect.
EDIT: Which is the same as what I got when I tried to create the userlogin system a second time.
Re: Linking the User Login Sytem to the Profile System
if (valid_credentials($_POST['username'], $_POST['password']) === false)try removing one of the equals signs.
Re: Linking the User Login Sytem to the Profile System
Nope, still not working . If i change it to true, it works but so does every other user/password combination. Which is strange. The information I'm typing in is also correct. I even tried creating the whole login system again today. I have hit exactly the same problem.
Re: Linking the User Login Sytem to the Profile System
Hmm... Do you get the username and password if youjaymeh wrote:Nope, still not working . If i change it to true, it works but so does every other user/password combination. Which is strange. The information I'm typing in is also correct. I even tried creating the whole login system again today. I have hit exactly the same problem.
print_r($_POST);?
Re: Linking the User Login Sytem to the Profile System
Yeah, they both show up. Its almost like they cant talk to the database which weird.
Array ([username] => jaymeh [password] => jaymeh
Array ([username] => jaymeh [password] => jaymeh
Re: Linking the User Login Sytem to the Profile System
are you sure you're establishing a connection to the database then? If you are then I'm clueless.
Re: Linking the User Login Sytem to the Profile System
Ill check the user exists function to see if that works because it means that im making a connection that way.
EDIT: There must be a connection since other sql functions work within the project. :/ I have no idea whats wrong with it...
EDIT: There must be a connection since other sql functions work within the project. :/ I have no idea whats wrong with it...
$user = mysql_real_escape_string($user); $pass = sha1($pass); $total = mysql_query("SELECT COUNT (`user_id`) FROM `users` WHERE `user_username` = '{$user}' AND `user_password` = '{$pass}'"); return (mysql_result($total, 0) == '1') ? true : false;
Re: Linking the User Login Sytem to the Profile System
I know whats wrong
You set password max length to 32 characters in your table. Sha1 will always produce a 40 character string.
32 characters won't match with 40
up your length limit to 40, re-register and it should work just fine
You set password max length to 32 characters in your table. Sha1 will always produce a 40 character string.
32 characters won't match with 40
up your length limit to 40, re-register and it should work just fine
Re: Linking the User Login Sytem to the Profile System
Hi Temor,
Thanks again. But I have passwords in the database which I have used to test but these passwords still do not work, unless the peice of code is looking for a password with sha1 coding in which case, I feel very silly .
Ill have a look and test that now
Thanks again
Jamie
Thanks again. But I have passwords in the database which I have used to test but these passwords still do not work, unless the peice of code is looking for a password with sha1 coding in which case, I feel very silly .
Ill have a look and test that now
Thanks again
Jamie
Re: Linking the User Login Sytem to the Profile System
Hi Temor,
Right now I feel so stupid, that worked a treat, I''d like to thank you for all your help over the past few days
Happy coding
Thank again
Jamie
Right now I feel so stupid, that worked a treat, I''d like to thank you for all your help over the past few days
Happy coding
Thank again
Jamie
Re: Linking the User Login Sytem to the Profile System
I'm happy we solved it Should not have taken this long though. I should have spotted that earlier
If you're ever in need of help, don't hesitate to post. I'm on here most of the time.
If you're ever in need of help, don't hesitate to post. I'm on here most of the time.