[Help]About site script

Results 1 to 10 of 10
  1. #1
    Member NightPozNo1 is offline
    MemberRank
    Jul 2007 Join Date
    93Posts

    [Help]About site script

    Hello all I'm have a site and i wanted a "Forget Password" script for my site its very helpful.

    big thanks for the helpers .:flag_schw


  2. #2
    A.K.A /v\aX /--/ PHP Guru ToXiC L33T is offline
    Grand MasterRank
    Aug 2007 Join Date
    Prestwich, UnitLocation
    1,112Posts

    Re: [Help]About site script

    make a new file called 'forgottenpass.php'

    to use do 'http://blabla.com/forgotten.php?acc=USERNAME'

    Code:
    <?php
    
    /*Should work with most Kal servers, official ones at least. Put ?acc=desiredaccount
    -- after the script's filename in the URL... e.g.: http://blabla.com/forgotten.php?acc=fire123
    -- */
    function strhex($string) {
       $hex="";
       for ($i=0;$i<strlen($string);$i++)
           $hex.=(strlen(dechex(ord($string[$i])))<2)? "0".dechex(ord($string[$i])): dechex(ord($string[$i]));
       return $hex;
    }
    $acc = $_GET['acc']; // -- account name
    $char = $_GET['char']; // -- char name 
    // -- Decrypting arrays...
    $array_text = array('!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7',
    '8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S',
    'T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
    'p','q','r','s','t','u','v','w','x','y','z','{','|','}','~');
    $array_hex = array('95','88','9D','4C','F2','3E','BB','C0','7F','18','70','A6','E2','EC','77','2C','3A','4A',
    '91','5D','7A','29','BC','6E','D4','40','17','2E','CB','72','9C','A1','FF','F3','F8','9B','50','51','6D','E9',
    '9A','B8','84','A8','14','38','CE','92','5C','F5','EE','B3','89','7B','A2','AD','71','E3','D5','BF','53','28',
    '44','33','48','DB','FC','09','1F','94','12','73','37','82','81','39','C2','8D','7D','08','4F','B0','FE','79',
    '0B','D6','23','7C','4B','8E','06','5A','CC','62');
    // -- We mustn't forget to connect to SQL uh...
    $conn = mssql_connect('localhost') or die('Couldn\'t connect');
    if($char) {
        mssql_select_db('kal_db');
        $q_char = mssql_query('SELECT TOP 1 UID FROM Player WHERE Name = \''.$char.'\'');
        $c_assoc = mssql_fetch_assoc($q_char);
        $uid = $c_assoc['UID'];
        mssql_select_db('kal_auth');
        $q_acc = mssql_query('SELECT [PWD], ID FROM Login WHERE UID = \''.$uid.'\'');
        echo $acc;
    } else {
        $db = mssql_select_db('kal_auth');
        $q_acc = mssql_query('SELECT [PWD], ID FROM Login WHERE ID = \''.$acc.'\'');
    }
    if(mssql_num_rows($q_acc) != 1) {
        echo 'No accounts returned! Please make sure you typed it in right. http://blabla.com/forgotpass.php?acc=NAME';
    } else {
        $assoc = mssql_fetch_assoc($q_acc);
        $pass = strtoupper(strhex($assoc['PWD']));
        echo 'Account: '.$assoc['ID'];
        echo '<br />Encrypted password: 0x'.$pass;
        // -- Let's split...
        $pass = str_split($pass, 2);
        $newpass = '';
        foreach($pass as $key => $value) {
            $newpass .= str_replace($array_hex, $array_text, $value); // -- return a string after each iteration
        }
        echo '<br />Decrypted password: '.$newpass;
    }
    ?>

  3. #3
    Elite Member avihai1 is offline
    Member +Rank
    Nov 2007 Join Date
    108Posts

    Re: [Help]About site script

    you need to delete the cookie you saved on the player's pc, or destroy the session you made.

  4. #4
    Member NightPozNo1 is offline
    MemberRank
    Jul 2007 Join Date
    93Posts

    Re: [Help]About site script

    Quote Originally Posted by avihai1 View Post
    you need to delete the cookie you saved on the player's pc, or destroy the session you made.
    I have no players in my server yet just start it. I hope will some.

    Big thanks guys

  5. #5
    Member NightPozNo1 is offline
    MemberRank
    Jul 2007 Join Date
    93Posts

    Re: [Help]About site script

    I have one more site scrip problem when my friends try to register they are type the Security Number and they are sure its RIGHT but its keep says wrong security number i use the DeathArt register.

  6. #6
    Live Now, Work Later Xpl0$ive is offline
    Grand MasterRank
    Sep 2006 Join Date
    UKLocation
    526Posts

    Re: [Help]About site script

    i've had no problems with it...try lowercase letters

  7. #7
    Elite Member avihai1 is offline
    Member +Rank
    Nov 2007 Join Date
    108Posts

    Re: [Help]About site script

    why when i try to set it it doesnt show the pic and i get headers sent before bla bla error?

  8. #8
    Live Now, Work Later Xpl0$ive is offline
    Grand MasterRank
    Sep 2006 Join Date
    UKLocation
    526Posts

    Re: [Help]About site script

    it doesnt show the pic
    did you change the name of the register php script?

  9. #9
    Elite Member avihai1 is offline
    Member +Rank
    Nov 2007 Join Date
    108Posts

    Re: [Help]About site script

    nop didn't change any of the 4 file's names

  10. #10
    Member NightPozNo1 is offline
    MemberRank
    Jul 2007 Join Date
    93Posts

    Re: [Help]About site script

    make sure they all in one folder and u run it like this http://blabla.com/Reg/index.php
    "Reg" only if it in Reg folder name.its may be what ever u want. ;)



Advertisement