Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::MiniLogin

Support::MiniLogin Support forum for problems with the official MiniLogin release.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2008, 01:51 AM
fault
Hill Giant
 
Join Date: Sep 2005
Posts: 114
Default

I am actually not able to get this to work.

PHP Code:
<?php
if(!isset($_POST['Submit'])){
?>
  <form id="form1" name="form1" method="post" action="reg.php">
    <table width="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="174" align="right" valign="top"><div align="right">Username:&nbsp;&nbsp;</div></td>
        <td width="326" align="left" valign="top"><input name="username" type="text" class="formelements" id="username" size="40" maxlength="9" />
        <br />
        <span class="style1">*must be 9 characters or less</span> </td>
      </tr>
      <tr>
        <td align="right" valign="top"><div align="right">Password:&nbsp;&nbsp;</div></td>
        <td align="left" valign="top"><input name="password" type="password" class="formelements" id="password" size="40" maxlength="9" />
          <br />
          <span class="style1">*must be 9 characters or less</span></td>
      </tr>
      <tr>
        <td colspan="2" align="center" valign="top"><input name="Submit" type="submit" class="formelements" value="Login/Create" />&nbsp;&nbsp;&nbsp;<input name="Reset" type="reset" class="formelements" value="Clear" /></td>
      </tr>
    </table>
  </form>
<?php
} else {
    
//set font color
    
$link mysql_connect($DB_ADDY,$DB_USER,$DB_PASS);
    
mysql_select_db($DB_DB,$link);
    
$sql "SELECT * FROM `account` WHERE `name` = '"$_POST['username']. "'";
    
$res mysql_query($sql,$link);
    if(
mysql_num_rows($res) != 0){
        
//username was found
        
$info mysql_fetch_assoc($res);
        if(
$info['password'] == $_POST['password']){
            
//password matches
            
if($_SERVER['REMOTE_ADDR'] != $info['minilogin_ip']){
                
//ip address has changed
                
$sql "UPDATE `account` SET `minilogin_ip` = '"$_SERVER['REMOTE_ADDR']. "' WHERE `name` = '"$_POST['username']. "' AND `password` = '"$_POST['password']. "'";
                
$sql2 "UPDATE `account` SET `minilogin_ip` = '0.0.0.0' WHERE `minilogin_ip` = '"$_SERVER['REMOTE_ADDR']. "'";
                if((
$res mysql_query($sql2,$link)) && mysql_query($sql,$link)){
                    echo 
'<font color="#00FF00">';
                    echo 
'Your IP address was successfully updated. You may now start EverQuest Titanium Edition and log in to the server.';
                    echo 
'</font>';
                } else {
                    echo 
'<font color="#FF0000">';
                    echo 
'There was an error updating your IP address. Please try again later or contact an admin for assistance.';
                    echo 
'</font>';
                }
            } else {
                
//ip didnt change
                
echo '<font color="#00FF00">';
                echo 
'Your IP address has not changed. You may now start EverQuest Titanium Edition and log in to the server.';
                echo 
'</font>';
            }
        } else {
            
//password was wrong
            
echo '<font color="#FF0000">';
            echo 
'The username: '$_POST['username']. '<br />Already exists in our database, and the password<br />you entered for it was incorrect.<br />';
            echo 
'If this is your account, please <a href="index.php">go back</a>, re-enter your password, and try again.<br />';
            echo 
'If you were attempting to create a new account, please try a different user name.';
            echo 
'</font>';
        }
    } else {
        
//username was not found create it now
        
$newno "SELECT `id` FROM `account` ORDER BY `id` DESC LIMIT 1";
        
$res mysql_query($newno,$link);
        
$newno mysql_fetch_assoc($res);
        
$newno = ($newno['id'] + 1);
        
$sql "INSERT INTO `account` VALUES ("$newno",'"$_POST['username']. "','',0,'"$_POST['password']. "',"$admin_level","$newno",0,0,'"$_SERVER['REMOTE_ADDR']. "',0,0)";
        
$sql2 "UPDATE `account` SET `minilogin_ip` = '0.0.0.0' WHERE `minilogin_ip` = '"$_SERVER['REMOTE_ADDR']. "'";
        if((
$res mysql_query($sql2,$link)) && mysql_query($sql,$link)){
            echo 
'<font color="#00FF00">';
            echo 
'New account created successfully. You may now start EverQuest Titanium Edition and log in to the server using:<br />';
            echo 
'Username: '$_POST['username']. '<br />Password: '$_POST['password']. '<br />*username and password are case sensitive!';
            echo 
'</font>';
        } else {
            echo 
'<font color="#FF0000">';
            echo 
'There was an error while trying to create your account. Please try again later.';
            echo 
'</font>';
        }
    }
}
?>
No matter what I do it always redirects to the red *error has occured while trying to create account*


Database info is correct on it..
Reply With Quote
  #2  
Old 04-10-2008, 05:02 AM
corvanus
Banned
 
Join Date: Apr 2008
Posts: 26
Default

first take out the ' s at 'account' they are unneeded and generally through syntax errors there same with 'name' only after the equals do you need them second add a semo colon after '" . $_POST[username] . '"' after the last singel quote and remove the single quotes at 'username' well you get the idea you have a ton of quotes where you dont need them so my guess is that is part of your errors right there then again you could always just use the premade pequpdater script and solve all your problems lol
Reply With Quote
  #3  
Old 04-10-2008, 11:03 AM
fault
Hill Giant
 
Join Date: Sep 2005
Posts: 114
Default

Quote:
Originally Posted by corvanus View Post
first take out the ' s at 'account' they are unneeded and generally through syntax errors there same with 'name' only after the equals do you need them second add a semo colon after '" . $_POST[username] . '"' after the last singel quote and remove the single quotes at 'username' well you get the idea you have a ton of quotes where you dont need them so my guess is that is part of your errors right there then again you could always just use the premade pequpdater script and solve all your problems lol
uh this is the *premade updater*
Reply With Quote
  #4  
Old 04-10-2008, 11:21 AM
corvanus
Banned
 
Join Date: Apr 2008
Posts: 26
Default

odd i use the peq updater and havent had any issues with it at all worked like a charm after a couple quick edits
Reply With Quote
  #5  
Old 04-10-2008, 11:23 AM
corvanus
Banned
 
Join Date: Apr 2008
Posts: 26
Default

what version of mysql and php are you using and have you double checked the db settings?
Reply With Quote
  #6  
Old 04-10-2008, 11:27 AM
corvanus
Banned
 
Join Date: Apr 2008
Posts: 26
Default

come to think of it why dont you drop in a line to show the query and results that way you can see precisly what the error is mysql is returning
Reply With Quote
  #7  
Old 04-14-2008, 08:15 PM
Theeper
Discordant
 
Join Date: May 2004
Posts: 290
Default

There is a couple small errors in this script I noticed.

1. There is a variable declaration near line 22 that is missing an equals sign.

Code:
$server_name "Name of Your Server"; //set the name of your server here
.. should be ..

Code:
$server_name = "Name of Your Server"; //set the name of your server here
Also, the form is pointing to index.php, although the script is called peq_updater.php. Change
this line ..

Code:
<form id="form1" name="form1" method="post" action="index.php">
.. to ..

Code:
<form id="form1" name="form1" method="post" action="<?=$_SERVER[PHP_SELF]; ?>">
Other than that, it seems to work.
Reply With Quote
Reply

Thread Tools
Display Modes

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

   

All times are GMT -4. The time now is 09:53 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3