944,139 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 1226
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Nov 1st, 2009
0
Re: Log In Script Problem
Rather than:
PHP Syntax (Toggle Plain Text)
  1. $data = mysqli_query($dbc, $query);
Try this:
PHP Syntax (Toggle Plain Text)
  1. if (!$data = mysqli_query($dbc, $query)) {
  2. printf("Error message: %s\n", mysqli_error($dbc));
  3. }

It should throw an error in the SQL statement.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Nov 1st, 2009
0
Re: Log In Script Problem
It still didn't work
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
phouse512 is offline Offline
75 posts
since Jul 2008
Nov 1st, 2009
0
Re: Log In Script Problem
Do you have phpMyAdmin?

If you do, copy the query from your script and run it directly in there.

You say 'It still didn't work', do you mean it does exactly the same, or are you getting additional/different errors after changing the code?
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Nov 2nd, 2009
0
Re: Log In Script Problem
Sorry, I was in a hurry

But I added the ifthen statement that you had, but I'm still getting the 'enter a valid password and username' error. I do have phpMyAdmin, so do you mean to do something like this:

PHP Syntax (Toggle Plain Text)
  1. SELECT user_id, username FROM login WHERE username = '$user_username' AND password = SHA('$user_password')

EDIT: I see where I messed up, in the example there is the SHA encryption, but its not encrypted in the database. So I fixed it now
Last edited by phouse512; Nov 2nd, 2009 at 5:25 pm.
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
phouse512 is offline Offline
75 posts
since Jul 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Search string is too exact help
Next Thread in PHP Forum Timeline: Is the a correct url regex?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC