PhotonicCoder Posted January 9, 2012 Share Posted January 9, 2012 Here is the Code: <?php include_once("functions/databaseconnect.php"); // Include Database File /* ****** CREATED BY Photonic ********* ****** 1/8/2012 *************************** */ // Start Login Script if(!empty($_POST['user001'])){ // If something is sent thru user input $user = cleanQuery($_POST['user001']); // Clean Sent Info if(!empty($_POST['pass001'])){ // If something is sent thru pass input $pass = cleanQuery($_POST['pass001']); // Clean Sent Info $q = "SELECT * FROM `Colonies001` WHERE `Username001` = '$user'"; // Select All Info from Database Where username is the one sent in user input $res = mysql_query($q) or die(mysql_error()); // Get SQL Resulting Information $row = mysql_fetch_array($res); // Add Information to Variable. if(!empty($res)){ // If information comes back from SQL Result $passEnc = md5($pass); // Encrypt Password for Database Usage. if($row['Passsword001']==$passEnc){ // If Database password is Equal to Encrypted Password $_SESSION['account'] = $row['id']; // Set Session to Account ID for Info Retrieval. header("Location: ingame.php?error=Welcome Back ".$user."!"); // Send Ingame Welcome Back User! }else{ // Else Wrong Pass header("Location: index.php?error=Incorrect Account Information!"); // Send Error } }else{ // Else Query header("Location: index.php?error=Account does not Exist with that Information!"); // Send to Login Page with Error } }else{ header("Location: index.php?error=You must enter a Valid Password!"); } }else{ header("Location: index.php?error=You must enter a Valid Username!"); } ?> Ok even tho the $row['Passsword001'] and $passEnc is the same (I have died both of them out and they ARE the same) it keeps throwing me back to line 43: this keeps running When I know it should not be header("Location: index.php?error=Incorrect Account Information!"); // Send Error Please Help Pho. Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted January 9, 2012 Share Posted January 9, 2012 is that extra 's' a typo, or the actual column name? $row['Passsword001'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.