Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Web [Tut] How to allow players to fix "ID is already Logged in via Website"

Status
Not open for further replies.
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
FOR ODINMS
Can be changed for any other by editing fix.php insert value
Re: ID is already logged in when acct is actually logged out..
I found it quite annoying and decided to allow players to fix their accounts themselves without bugging me out..

I will cover how to enable PHP in HTML pages below if your page is running any PHP scripts.

Ok copy these into notepad and save as index.html or anything u wish to put as ur link. U can also put this in any segment of your webpage, it must be .HTML
Code:
<form action="fix.php" method="post"> 
Login: <input name="login" type="text" />
<br><br>
Password: <input name="pass" type="password" />
<br><br>
<input type="submit" value="Fix Login!"/>
</form>

Copy this into notepad and rename it fix.php

Code:
<title>Fix Login</title>
<body background="bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php
include('config.php');

$login = $_POST['login'];
$pass = $_POST['pass'];

$resultsalt = mysql_query("SELECT salt FROM accounts WHERE name='$login'"); 
if ($row = mysql_fetch_array($resultsalt)){
   do {
         $salt = $row["salt"];
   } while ($row = mysql_fetch_array($resultsalt)); 
} else { 
echo "You need to be logged off before you can do this!";
}
$password = hash('sha512', $pass . $salt);

$sqlquery = "SELECT * FROM accounts WHERE name = '$login' AND password = '$password'";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result); //LINE NUMBER 23

$i = 0;
if ($number < 1) //10
{
echo "This account doesn't exist, or the password is wrong.";
}
else
{
if ($number > $i)
{
$sqlquery2 = "Update accounts SET loggedin = 0 WHERE name='$login'";
mysql_query("$sqlquery2") or DIE (mysql_error());
echo "The account has been unbugged successfully!";
}
}

?>
<center><h5>Credits to Voldermord<h5></center>

lastly, copy the following into notepad and rename config.php

Code:
   <?php
//Database details

$host['name'] = 'localhost';                // your host
$host['username'] = 'root';       // your database username
$host['password'] = 'yourpasswordhere';   // your database password
$host['databasename'] = 'odinms';       // your database name

$db = mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to the database');
mysql_select_db($host['databasename'], $db);
?>

Lastly Put this into another notepad file and save as ".htaccess"
important, must include the ""
This is to enable PHP in HTML pages

Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
Do those and copy to your PHP enabled webserver, apache mod or Wampserver root folder or whereever ur htdocs/www folder is.
* The .htaccess must be in the same folder as the 3 other files.

Edit
Thanks ddxsamx - pointing out the mistake which would render an error i will definitely get spammed for :D

Edit
The page to change is NOT the fix.php if u try to go there it will juz give u a download link. The page is the .html page where u EMBEDDED the first code at the top below the bolded words.
 
Last edited:
Newbie Spellweaver
Joined
May 30, 2008
Messages
6
Reaction score
0
Re: [GUIDE]How to allow players to fix "ID is already Logged in via Website"

You have forgotten a [ in your config.php

$db = mysql_connect($host['name'], $host['username'], $host['[password']) OR die ('Cant connect to the database');
mysql_select_db($host['databasename'], $db);
?>

Either that, or you've added an extra -

"[" in $host['[password'] = 'yourpasswordhere'; // your database password


But great work! =)
 
Newbie Spellweaver
Joined
May 27, 2008
Messages
26
Reaction score
0
Re: [GUIDE]How to allow players to fix "ID is already Logged in via Website"

Nice job!
 
Initiate Mage
Joined
Nov 21, 2005
Messages
0
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Sorry, i need to ask, where is the wamp root folder? I tried putting it in the www folder along with my reg page but the Login Fix part still doesn't show.
 
Newbie Spellweaver
Joined
Sep 10, 2006
Messages
58
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

yea it come out a download link of the fix.php
 
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

you dont go to /%/fix.php

you put the

Code:
<form action="fix.php" method="post"> 
Login: <input name="login" type="text" />
<br><br>
Password: <input name="pass" type="password" />
<br><br>
<input type="submit" value="Fix Login!"/>
</form>

into a html file and u go to the .html

basically the above is the form. Embed into any part of your webpage. Put the fix.php and config.php in the same folder. people go through the webpage u made with the form inside to fix their login status.
 
Initiate Mage
Joined
Jun 10, 2008
Messages
1
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Always When i try to do a private server it does'nt work cuz
it pop's up a window it says:
Unable to connect to the server.
Either you are not online or maplestory is going
through a server check
Please check the maplestory homepage for more
information.
 
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Always When i try to do a private server it does'nt work cuz
it pop's up a window it says:
Unable to connect to the server.
Either you are not online or maplestory is going
through a server check
Please check the maplestory homepage for more
information.

well this isnt the place to ask about that..
 
Junior Spellweaver
Joined
Jan 11, 2007
Messages
115
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

what i do worng:


Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 4

Warning: include() [function.include]: Failed opening 'config.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 4

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 10
You need to be logged off before you can do this!
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 21
This account doesn't exist, or the password is wrong.
Credits to Voldermord
 
Newbie Spellweaver
Joined
Mar 27, 2008
Messages
26
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

FOR ODINMS
Can be changed for any other by editing fix.php insert value
Re: ID is already logged in when acct is actually logged out..
I found it quite annoying and decided to allow players to fix their accounts themselves without bugging me out..

I will cover how to enable PHP in HTML pages below if your page is running any PHP scripts.

Ok copy these into notepad and save as index.html or anything u wish to put as ur link. U can also put this in any segment of your webpage, it must be .HTML
Code:
<form action="fix.php" method="post"> 
Login: <input name="login" type="text" />
<br><br>
Password: <input name="pass" type="password" />
<br><br>
<input type="submit" value="Fix Login!"/>
</form>
Copy this into notepad and rename it fix.php

Code:
<title>Fix Login</title>
<body background="bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<?php
include('config.php');

$login = $_POST['login'];
$pass = $_POST['pass'];

$resultsalt = mysql_query("SELECT salt FROM accounts WHERE name='$login'"); 
if ($row = mysql_fetch_array($resultsalt)){
   do {
         $salt = $row["salt"];
   } while ($row = mysql_fetch_array($resultsalt)); 
} else { 
echo "You need to be logged off before you can do this!";
}
$password = hash('sha512', $pass . $salt);

$sqlquery = "SELECT * FROM accounts WHERE name = '$login' AND password = '$password'";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result); //LINE NUMBER 23

$i = 0;
if ($number < 1) //10
{
echo "This account doesn't exist, or the password is wrong.";
}
else
{
if ($number > $i)
{
$sqlquery2 = "Update accounts SET loggedin = 0 WHERE name='$login'";
mysql_query("$sqlquery2") or DIE (mysql_error());
echo "The account has been unbugged successfully!";
}
}

?>
<center><h5>Credits to Voldermord<h5></center>
lastly, copy the following into notepad and rename config.php

Code:
   <?php
//Database details

$host['name'] = 'localhost';                // your host
$host['username'] = 'root';       // your database username
$host['password'] = 'yourpasswordhere';   // your database password
$host['databasename'] = 'odinms';       // your database name

$db = mysql_connect($host['name'], $host['username'], $host['password']) OR die ('Cant connect to the database');
mysql_select_db($host['databasename'], $db);
?>
Lastly Put this into another notepad file and save as ".htaccess"
important, must include the ""
This is to enable PHP in HTML pages

Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
Do those and copy to your PHP enabled webserver, apache mod or Wampserver root folder or whereever ur htdocs/www folder is.
* The .htaccess must be in the same folder as the 3 other files.

Edit
Thanks ddxsamx - pointing out the mistake which would render an error i will definitely get spammed for :D

Edit
The page to change is NOT the fix.php if u try to go there it will juz give u a download link. The page is the .html page where u EMBEDDED the first code at the top below the bolded words.



Or you can just use Navicat and if you have a 2 on your logged in tab. change it to 0 and then it works but i'm not sure if it's permanent :boxed2:
 
Junior Spellweaver
Joined
Jan 11, 2007
Messages
115
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Grade Work!
 
Initiate Mage
Joined
Jun 25, 2008
Messages
2
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Hey i did all those stuff you said and my website doesn't have that DC id thing.
 
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

what i do worng:


Warning: include(config.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 4

Warning: include() [function.include]: Failed opening 'config.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 4

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 10
You need to be logged off before you can do this!
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\Abyss Web Server\htdocs\fix.php on line 21
This account doesn't exist, or the password is wrong.
Credits to Voldermord

config.php isnt inside ur folder perhaps? permissions set? configuration changed to match yours?
 
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Hey i did all those stuff you said and my website doesn't have that DC id thing.

go to the page where u embedded the first codes in my post.. eg if u embedded in index.html go to
 
Newbie Spellweaver
Joined
Jun 26, 2008
Messages
22
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Edit: Nvm..
 
Newbie Spellweaver
Joined
Jun 20, 2008
Messages
36
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

is there something wrong with this code?

"$number = mysql_num_rows($result); //LINE NUMBER 23"

when i save and tried, it shows me this

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource......
 
Newbie Spellweaver
Joined
Aug 26, 2005
Messages
58
Reaction score
1
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

not that i know off..
 
Junior Spellweaver
Joined
Jun 26, 2008
Messages
136
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

I get a white page when i click "fix login" T.T. Happens in registration pages too. I'm using Abyss web server please help thank you.
 
Initiate Mage
Joined
Jul 17, 2008
Messages
2
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

what is wrong here:

_query("SELECT salt FROM accounts WHERE name='$login'"); if ($row = mysql_fetch_array($resultsalt)){ do { $salt = $row["salt"]; } while ($row = mysql_fetch_array($resultsalt)); } else { echo "You need to be logged off before you can do this!"; } $password = hash('sha512', $pass . $salt); $sqlquery = "SELECT * FROM accounts WHERE name = '$login' AND password = '$password'"; $result = mysql_query($sqlquery); $number = mysql_num_rows($result); //LINE NUMBER 23 $i = 0; if ($number < 1) //10 { echo "This account doesn't exist, or the password is wrong."; } else { if ($number > $i) { $sqlquery2 = "Update accounts SET loggedin = 0 WHERE name='$login'"; mysql_query("$sqlquery2") or DIE (mysql_error()); echo "The account has been unbugged successfully!"; } } ?>

i get that when i submit the login fix
 
Initiate Mage
Joined
Jun 1, 2008
Messages
2
Reaction score
0
Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

Hi the loged in page works fine but i have a question, i already have my registration page in my httdocs folder under aybss web server and if i place these files in the httdocs folder also it just covers up my registration page. How would I make them both work with abyss web server cuase once i add these files to my httdocs when i click my registration link this comes up instead so how would i make them both work?
 
Status
Not open for further replies.
Back
Top