#1
|
||||
|
||||
Logging In Problem O_O
This is a some what serious problem, it seems none of my users, nor myself, are able to login to the site. The password resets are not working, I even changed a user's password for them, but the password didn't work. Here's my login.php, hope someone can see something I've missed!
Code:
<?php include("inc/functions.php"); //***************// // START SCRIPT // //***************// if($isloggedin == "yes"){ $article_title = $langislog; $article_content = $langislogfull; echo 'no'; }else{ //User is not logged in, so let's attempt to log them in... $username = $_POST["username"]; $password = $_POST["password"]; //User is not logged in $article_content = "<form name='form1' method='post' action='login.php'> <p>Username: <input name='username' type='text' id='username'> </p> <p>Password: <input name='password' type='password' id='password'> </p> <p> <input type='submit' name='Submit' value='Submit'> </p> <p>Don't have an account?<br> <a href='register.php'>Register Free</a> </p> <a href='forgotpass.php'>Forgot your password? Click Here</a> </form>"; if($loggedinname == "" and $password == ""){ // User is viewing login form $article_title = "Member Login:"; $article_content = $loginform; } else if(($username != "" and $password == "") or ($username == "" and $password != "") ){ //Something was left blank $article_title = "Login Error:"; $article_content = "Something was left blank. Please try logging in again.<br><br>".$loginform.""; } else if($username != "" and $password != ""){ // Try to log the user in $password = md5($password); $query = "SELECT * FROM ".$prefix."users WHERE username = '$username'"; $result = @runquery($query); $num = @mysql_numrows($result); //Loop out code $i=0; while ($i < 1) { $luser=@mysql_result($result,$i,"username"); $lpass=@mysql_result($result,$i,"password"); $i++; } if($username == $luser and $password == $lpass){ $article_title = "Login Successful!"; $article_content = "Welcome back ".$username.". You are now logged in. <a href='account.php'>Click Here to view or edit your account.</a>"; // Set the cookie $Month = 2592000 + time(); setcookie("auser",$username,$Month); setcookie("apass",$password,$Month); } else{ $article_title = "Login Failed!"; $article_content = "Sorry, we could not log you on with the details specified. You can <a href='login.php'>try again</a> or <a href='forgotpass.php'>request a password reset.</a>"; $fail = 1; } } } //***************// // OUTPUT PAGE // //***************// echo showpage($article_title, $article_content, $date); ?>
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 09-04-2011 at 11:09 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help on Logging in to 1.3.3 ! | Missy Master | Questions and Supports | 5 | 04-18-2015 02:38 AM |
Language Exception Error when Logging in / out | LucasA33 | Questions and Supports | 3 | 12-21-2013 06:31 AM |
Need Help Logging In | blueskyler | Questions and Supports | 3 | 12-13-2011 07:26 PM |
Logging in for the First Time | Rozel | Suggestions and Feature Requests | 9 | 10-23-2011 01:50 PM |
What's New? |
What's Hot? |
What's Popular? |