Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 05-17-2011, 10:27 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,535
Tequila is on a distinguished road
Default Login page..?

I'm not sure if I've mentioned this before, but the log in page does not display anything, as in http://crystalhollow.com/login.php

I've been playing with things that I've changed on my site, and cannot log back in under my own account.

This may be a problem, here is the code for my login.php page, anyone figure this one out?

PHP Code:
<?php

include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

if($isloggedin == "yes"){

$article_title $langislog;
$article_content $langislogfull;

}
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

$loginform "<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);

?>
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #2  
Old 05-18-2011, 09:55 AM
Kaeliah's Avatar
Kaeliah Kaeliah is offline
Premium Member
 
Join Date: Sep 2010
Location: Pennsylvania, United States
Posts: 485
Gender: Female
Credits: 32,483
Kaeliah will become famous soon enough
Send a message via AIM to Kaeliah Send a message via MSN to Kaeliah
Default

I glanced over it, I don't have much time now which is why but the only thing that stuck out in my mind is the use of the loop code. there is no need for it because all usernames should be unique.
__________________
[My Shop] ♥ [My Blog] ♥ [Subscribe] ♥ [My Mods] ♥ [Mod TOS]
Reply With Quote
  #3  
Old 05-18-2011, 02:03 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,535
Tequila is on a distinguished road
Default

Quote:
Originally Posted by Kaeliah View Post
I glanced over it, I don't have much time now which is why but the only thing that stuck out in my mind is the use of the loop code. there is no need for it because all usernames should be unique.
See that's something that I would not have caught...
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
  #4  
Old 05-18-2011, 04:39 PM
Tequila's Avatar
Tequila Tequila is offline
The Grim One
 
Join Date: Jan 2009
Location: Souther Tier, New York State
Posts: 1,356
Gender: Female
Credits: 97,535
Tequila is on a distinguished road
Default

Derp! I think I figured it out, see if you can find my fix here:
PHP Code:
<?php

include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

if($isloggedin == "yes"){

$article_title $langislog;
$article_content $langislogfull;

}
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_title "Log 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);

?>
Since I'm using a customized site, this actually works, as I have no sidefeed called.
__________________
Artist. Designer. Gamer. Mother.
[portfolio] [tarot] [Rune Hollow] [freebies]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
/login page not found. zoe Questions and Supports 6 05-10-2015 04:01 PM
Help Making Stats Page = Click Page & Lineages? squiggler Questions and Supports 2 02-22-2014 04:42 AM
Adopt Page & Pound Page change? tahbikat Questions and Supports 3 02-14-2014 03:19 PM
Redirect to Previous Page after Login/Logout fadillzzz Mys v1.1.x Mods 6 02-02-2011 05:24 PM
login fix 12345 Questions and Supports 0 03-13-2009 02:03 PM


All times are GMT -5. The time now is 04:23 AM.

Currently Active Users: 9036 (0 members and 9036 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636