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 04-11-2009, 08:07 AM
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,198
Tequila is on a distinguished road
Default Failed Login

Haven't been able to log new users in on my site. The only mods running are the User List, profile pages, and currency (shop hasn't been added yet).

All of the register files are fine, and I don't even see any problems with the login page.

Any ideas?
Reply With Quote
  #2  
Old 04-11-2009, 10:39 AM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,699
BMR777 is on a distinguished road
Default RE: Failed Login

Do any of those mods alter the "users" table in the database? If they did, then you have to open register2.php and add an extra field to the portion of the script that creates a new user, as if the fields do not match up then there will be issues.

If you ran any queries on the users table post them here and I'll tell you what to edit. Otherwise let me know if you haven't edited the users table at all.

Brandon
Reply With Quote
  #3  
Old 04-11-2009, 11:05 AM
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,198
Tequila is on a distinguished road
Default RE: Failed Login

I did exactly what the mod set up said to do (including the bit added to register2).

Here's my register2 file:
PHP Code:
<?php

// Easy Adoptables Script by Brandon Rusnak
// Get our includes out of the way

include("inc/functions.php");
include(
"inc/config.php");
include(
"inc/settings.php");
include(
"inc/nbbc.php");  // BBCODE Parser
$bbcode = new BBCode;


// Define our Template File

$file $current_theme;

//Get the user's data from the form

$username $_POST["username"];
$pass1 $_POST["pass1"];
$pass2 $_POST["pass2"];
$email $_POST["email"];
$tos $_POST["tos"];

//Protect the database
$username preg_replace("/[^a-zA-Z0-9\\040.]/"""$username);
$pass1 preg_replace("/[^a-zA-Z0-9s]/"""$pass1);
$pass2 preg_replace("/[^a-zA-Z0-9s]/"""$pass2);
$email preg_replace("/[^a-zA-Z0-9@._-]/"""$email);
$tos preg_replace("/[^a-zA-Z0-9s]/"""$tos);

// Connect to our database

$conn mysql_connect($dbhost$dbuser$dbpass) or die ('Error connecting to mysql database!');
mysql_select_db($dbname);



// Should we show the extra pages in the nav bar?

$link1 "";
if(
$show_extra_page1 == "yes"){
$link1 "<li><a href='$extra_page1_link'>$extra_page1_name<span class='tab-l'></span><span class='tab-r'></span></a></li>"
}

$link2 "";
if(
$show_extra_page2 == "yes"){
$link2 "<li><a href='$extra_page2_link'>$extra_page2_name<span class='tab-l'></span><span class='tab-r'></span></a></li>"
}

// Do the template changes and echo the ready template

$template file_get_contents($file);
$template replace(':SITETITLE:',$site_title,$template);
$template replace(':SITENAME:',$site_name,$template);
//$template = replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLEDATE:',date('Y-m-d'),$template);
//$template = replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':LINK1:',$link1,$template);
$template replace(':LINK2:',$link2,$template);
$template replace(':LINK3:',$link3,$template);

//Get the featured adoptable...
$featured getfeatured();
$template replace(':FEATURED:',$featured,$template);

//Ad Management
$header = @file_get_contents("ads/header.txt");
$footer = @file_get_contents("ads/footer.txt");
$tower = @file_get_contents("ads/tower.txt");

$header stripslashes($header);
$footer stripslashes($footer);
$tower stripslashes($tower);

$template replace(':HEADERAD:',$header,$template);
$template replace(':FOOTERAD:',$footer,$template);
$template replace(':TOWERAD:',$tower,$template);


//Is the user logged in?
$isloggedin "no";
if (
$isloggedin == "yes"){

}
else{

//User is not logged in
$template replace(':WELCOMEORREGISTER:','<u>Member Login:</u>',$template);
$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>
</form>
"
;
$template replace(':LOGINORACCT:'$loginform ,$template);
}

//Check for errors...
if($username == "" or $pass1 == "" or $pass2 == "" or $email == ""){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','A required form element was left blank.  
Please <a href="register.php">go back</a> and fill out all the form elements and try again.'
,$template);
echo 
$template;
die();

}

if(
$tos != "tosyes"){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','You did not agree to the Terms of Service.  
You must agree to the TOS to use this site.'
,$template);
echo 
$template;
die();
}

if(
$pass1 != $pass2){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','Your passwords do not match.  
Please <a href="register.php">go back</a> and correct this issue.'
,$template);
echo 
$template;
die();
}

//Check that username does not already exist

$query "SELECT * FROM users WHERE username = '$username'";
$result = @mysql_query($query);
$num = @mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {

$luser=@mysql_result($result,$i,"username");


$i++;
}

$luser strtolower($luser);
$u2 $str strtolower($username);

if(
$luser == $u2){
$template replace(':ARTICLETITLE:','Error',$template);
$template replace(':ARTICLECONTENT:','Your username has been taken.  
Please <a href="register.php">go back</a> and select a different username.'
,$template);
echo 
$template;
die();
}

//All checks pass, create the user
$pass1 md5($pass1); //MD5 the password
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0')"); 

$template replace(':ARTICLETITLE:','Success',$template);
$template replace(':ARTICLECONTENT:','Your account has been created with the username '.$username.'.  
<a href="login.php">Click here to log in to your account.</a>'
,$template);


echo 
$template;
?>
and my MySQL table setup (screenshot, I added items (but that may be my problem...) as I want the items to be for the users and their pets).


[attachment=157]
Reply With Quote
  #4  
Old 04-11-2009, 11:09 AM
BMR777 BMR777 is offline
Member
 
Join Date: Jan 2011
Posts: 1,122
Gender: Male
Credits: 10,699
BMR777 is on a distinguished road
Default RE: Failed Login

Yep, the problem is that you added that items field. Find:

PHP Code:
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0')"); 
Replace With:

PHP Code:
mysql_query("INSERT INTO users VALUES ('', '$username', '$pass1','$email','free','0','0')"); 
Every time you add a field to the users table you also have to make a space for that field in the register2.php file. This is one of the reasons I discourage mods modifying existing tables and encourage them to create new tables of their own. :)

Those users will need to re-register as they were never inserted into the users table.
Reply With Quote
  #5  
Old 04-11-2009, 11:20 AM
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,198
Tequila is on a distinguished road
Default RE: Failed Login

Heh, heh... I should have realized that...
I've been really having a bad Easter so far...
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
Admin failed to login IntoRain Questions and Supports 4 08-02-2013 03:42 PM
I FAILED Cindykt Questions and Supports 2 09-11-2011 09:21 AM
Login Failed rosepose Questions and Supports 5 05-27-2009 07:32 PM
Login Failed Hiddenzbu Questions and Supports 2 05-23-2009 12:52 PM
Failed Login..? Quillink Questions and Supports 3 03-19-2009 06:48 PM


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

Currently Active Users: 9591 (0 members and 9591 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