Log In Script Problem

Thread Solved

Join Date: May 2008
Posts: 525
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
0
  #11
Nov 1st, 2009
Rather than:
  1. $data = mysqli_query($dbc, $query);
Try this:
  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.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 44
Reputation: phouse512 is an unknown quantity at this point 
Solved Threads: 1
phouse512 phouse512 is offline Offline
Light Poster
 
0
  #12
Nov 1st, 2009
It still didn't work
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 525
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro
 
0
  #13
Nov 1st, 2009
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?
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 44
Reputation: phouse512 is an unknown quantity at this point 
Solved Threads: 1
phouse512 phouse512 is offline Offline
Light Poster
 
0
  #14
Nov 2nd, 2009
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:

  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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum


Views: 585 | Replies: 13
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC