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

Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Valued Member voldermord is offline
    MemberRank
    Aug 2005 Join Date
    141Posts

    [Tut] 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.
    Last edited by voldermord; 17-06-08 at 12:05 PM.


  2. #2
    Apprentice ddxsamx is offline
    MemberRank
    May 2008 Join Date
    20Posts

    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! =)

  3. #3
    Member xshinobii is offline
    MemberRank
    May 2008 Join Date
    LondonLocation
    69Posts

    Re: [GUIDE]How to allow players to fix "ID is already Logged in via Website"

    Nice job!

  4. #4
    Enthusiast relix is offline
    MemberRank
    Nov 2005 Join Date
    Somewhere on earthLocation
    25Posts

    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.

  5. #5
    Valued Member narut8251 is offline
    MemberRank
    Sep 2006 Join Date
    singaporeLocation
    123Posts

    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

  6. #6
    Valued Member voldermord is offline
    MemberRank
    Aug 2005 Join Date
    141Posts

    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.

  7. #7
    Novice ZorrousingZ is offline
    MemberRank
    Jun 2008 Join Date
    1Posts

    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.

  8. #8
    Valued Member voldermord is offline
    MemberRank
    Aug 2005 Join Date
    141Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Quote Originally Posted by ZorrousingZ View Post
    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..

  9. #9
    Account Upgraded | Title Enabled! Xskyline846 is offline
    MemberRank
    Jan 2007 Join Date
    243Posts

    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

  10. #10
    Enthusiast sush is offline
    MemberRank
    Mar 2008 Join Date
    42Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Quote Originally Posted by voldermord View Post
    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:

  11. #11
    Account Upgraded | Title Enabled! Xskyline846 is offline
    MemberRank
    Jan 2007 Join Date
    243Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Grade Work!

  12. #12
    Novice DeathScythee is offline
    MemberRank
    Jun 2008 Join Date
    3Posts

    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.

  13. #13
    Valued Member voldermord is offline
    MemberRank
    Aug 2005 Join Date
    141Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Quote Originally Posted by Xskyline846 View Post
    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?

  14. #14
    Valued Member voldermord is offline
    MemberRank
    Aug 2005 Join Date
    141Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Quote Originally Posted by DeathScythee View Post
    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 http://localhost/index.html

  15. #15
    Enthusiast lizaraxp is offline
    MemberRank
    Jun 2008 Join Date
    45Posts

    Re: [Guide] How to allow players to fix "ID is already Logged in via Website"

    Edit: Nvm..



Page 1 of 2 12 LastLast

Advertisement