I was gonna post this earlier but I was double checking if I had to do anything special if I was posting a code
if($_POST['Username'] and $_POST['Password']) {
$U = $_POST['Username'];
$P = $_POST['Password'];
$P = md5($P);
$query = "SELECT * FROM login WHERE ";
$query .= "Username = '".$U."' and Password = '".$P."'";
$result = mysql_query($query, $sql);
if(mysql_num_rows($result)) { echo("Your password works"); }
else { echo("Your password or username is invalid."); exit; }
}
I'm wondering if I should post this in the critque instead but I need some suggestions on encrypting it more..even thought this script works. I was thinking on making my script generating a MD5 thing about 100 times and then finally query it in MySQL. Then I figured if it was a hacker he would just decrypt it 100 times. (If decrypting a MD5 is possiable which I think it is..) Also I'm planning on making this script e-mail me everytime the ip to my account is different. This won't spam my e-mail box because my IP rarely changes and I'll be the only one to be logging =D but first I need some suggestions on securing my login script a bit more..(still wondering if this belongs in the critques forum)