
November 13th, 2012, 12:37 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
|
Hi,
what does "not work" mean? Do you get an error message? Does your computer crash?
Apart from that, I don't get what you're trying to do. OK, you have a function. But you don't use this function in your login script and instead write down some similar (but different) code. Um, is this another try?
The code itself also has several oddities. What's the point of repeating the same query twice? Why do you need a "while" loop to fetch a single row?
Also you must not store the password hash in the session. This is extremely unsecure and completely pointless (what do you need the hash for when the user is already logged in?). The password hash is supposed to be stored in exactly one column in the database and nowhere else. Not in the session, not in a cookie.
|