Hi i am having a problem, when i try logging in it is always saying "Invalid Login" im not sure what is going wrong, a week ago i had it working. I cant remember the change i did but i know its in one of theese files (dont worry about the styling, i know theres one div i havent closed lol :
if ($_POST['Submit']=='Login') { $md5pass = md5($_POST['pwd']); $sql = "SELECT id,user_email,full_name,money,level,crystals,userdp,health,exp,rep,class,bonus,tutorial,mana FROM users WHERE user_email = '$user_email' AND user_pwd = '$md5pass' AND user_activated='1'";
$result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result);
if ($_POST['Submit'] == 'Register') { if (strlen($_POST['email']) < 5) { die ("Incorrect email. Please enter valid email address.."); } if (strcmp($_POST['pass1'],$_POST['pass2']) || empty($_POST['pass1']) ) { //die ("Password does not match"); die("ERROR: Password does not match or empty..");
} if (strcmp(md5($_POST['user_code']),$_SESSION['ckey'])) { die("Invalid code entered. Please enter the correct code as shown in the Image"); } $rs_duplicates = mysql_query("select id from users where user_email='$_POST[email]'"); $duplicates = mysql_num_rows($rs_duplicates); if ($duplicates > 0) { //die ("ERROR: User account already exists."); header("Location: register.php?msg=ERROR: User account already exists.."); exit(); }
$md5pass = md5($_POST['pass2']); $activ_code = rand(1000,9999); $server = $_SERVER['HTTP_HOST']; $host = ereg_replace('www.','',$server); mysql_query("INSERT INTO users (`user_email`,`user_pwd`,`sex`,`joined`,`activation_code`,`char_name`,`log_name`) VALUES ('$_POST[email]','$md5pass','$_POST[sex]',now(),'$activ_code','$_POST[char_name]','$_POST[log_name]')") or die(mysql_error());
$message = "Thank you for registering an account with $server. Here are the login details...nn User Email: $_POST[email] n Password: $_POST[pass2] n Activation Code: $activ_code n ____________________________________________ *** ACTIVATION LINK ***** n Activation Link: http://$server/myown/activate.php?usr=$_POST[email]&code=$activ_code nn _____________________________________________ Thank you. This is an automated response. PLEASE DO NOT REPLY. ";
mail($_POST['email'] , "Login Activation", $message, "From: "Auto-Response" <notifications@$host>rn" . "X-Mailer: PHP/" . phpversion()); unset($_SESSION['ckey']); echo("Registration Successful! An activation code has been sent to your email address with an activation link...");
<div id="box"> <div id="footer"> </div> </div> </div> </div> </style> </center> </html> I dont think its this one as the connection is ok, but here it is anyway Code: <?php $dbname = 'stonersg_myown'; $link = mysql_connect('localhost','stonersg_myown','davemira1') or die("Couldn't make connection."); $db = mysql_select_db($dbname, $link) or die("Couldn't select database"); ?>