this is my first post here!
Though, I did not like playing around with the databases this early... *Shivers from all the errors*
Ok, so I made a php script that registers you and converts the password into md5. THat wasn't a probleme at all... but the login part... now that was something different!
Code: Select all
<?php
$username = str_replace("'","''",$_GET["un"]);
$password = md5($_GET["pw"]);
$host="X";
$un="X";
$pw="X";
$con = mysql_connect($host,$un,$pw);
if(!$con) {
die("Could not connect!" . mysql_error());
}
mysql_select_db("Users",$con);
$pw = md5($_GET['pw']);
$r1 = mysql_query("SELECT * FROM Users WHERE un = '$_GET[un]'");
$r2 = mysql_query("SELECT * FROM Users WHERE pw = '$password'");
if(mysql_fetch_array($r1) && mysql_fetch_array($r2)) {
echo("Correct login!");
}
if(!mysql_fetch_array($r1)) {
echo("Incorrect login!");
}
elseif(!mysql_fetch_array($r2)) {
echo("Incorrect password!");
}
?>Thanks.
Sincerely,
Zach.