I hope this makes sense!?!?
Well, not quite 😉
I do have a session-id, which however doesn't help me a lot. What I need is a link-identifier, which you get by doing:
$linkidentifier = mysql_(p)connect(...)
I can not store the linkid as a sessionvar (with or wo serialize, no matter). So in order to get my linkid, I need to reconnect - with username and password supplied).
Storing the password encrypted qould be a good idea, but for 'mysql_connect($Host,$User,$Pass), $Pass must be a plain-text password.
What's left is encoding the password with some algorithm, store it as session variable, retrieve and decode in the script and connect to the db...anything else left?!?
Tom
Stephen wrote:
1) Instead of repeating the username/password check everytime you wish to connect to the DB, try generating a session identifier (a random string of characters) that is stored in the DB along with the username and password. You can pass the session identifier between pages in the URL and check this against the DB. Its' alot safer this way, especially if the session identifier is 32 characters or more in length.
2) Use the md5() string encryption. This is a one way algorithm that allways results in a 32 charcter string, no matter how long the original string. Try:
$QUERY = "INSERT INTO table (username, password) VALUES ('$username', '" . md5($password) . "'";
I hope this makes sense!?!?