Jump to content

bogdan012794

Members
  • Posts

    13
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by bogdan012794

  1. Hi guys, i have the fallowing script and i want to modify it a little bit. so it will show the characters race as male or female. and i dont know how.

    this is the script.

    
    
    <CENTER>Name Race Class Level Gender</CENTER>
    
    <DIV ALIGN=LEFT>
    <?PHP                            
    
    require_once ('config.php');
    
    mysql_connect ("$host","$user","$pass");
    mysql_select_db ("$mangoscharacters");
    
    $result = mysql_query ("SELECT name, race, class, level, gender FROM characters WHERE online = 1");
    $num_online = mysql_num_rows($result);
    
    $class = array(1=>"[img=img/class/1.gif]",2=>"[img=img/class/2.gif]",3=>"[img=img/class/3.gif]",4=>"[img=img/class/4.gif]",5=>"[img=img/class/5.gif]",6=>"[img=img/class/6.gif]",
    
    7=>"[img=img/class/7.gif]",8=>"[img=img/class/8.gif]",9=>"[img=img/class/9.gif]",11=>"[img=img/class/11.gif]");
    $race = array(1=>"[img=img/race/1-0.gif]",2=>"[img=img/race/2-0.gif]",3=>"[img=img/race/3-0.gif]",4=>"[img=img/race/4-0.gif]",5=>"[img=img/race/5-0.gif]",6=>"[img=img/race/6-0.gif]",7=>"[img=img/race/7-0.gif]",8=>"[img=img/race/8-0.gif]",10=>"[img=img/race/10-0.gif]",11=>"[img=img/race/11-0.gif]");
    $gender = array(0=>"Male",1=>"Female");
    
    if($num_online < 1) {
     echo "<tr><td colspan='4' align='center'>No Players Online!</td></tr>";
    }
    
    for($i=0; $i<$num_online; $i++) {
     $row = mysql_fetch_array($result);
     $t_name = $row['name'];
     $t_race = $row['race'];
     $t_class = $row['class'];
     $t_lvl = $row['level'];
     $t_gender = $row['gender'];
     echo "
    
    $t_name";
     echo "  $race[$t_race]";
     echo "  $class[$t_class]";
     echo "  $t_lvl";
     echo "  $gender[$t_gender]</p>";
    }
    
    ?>
    

    here is the problem

    $race = array(1=>"[img=img/race/1-0.gif]",2=>"[img=img/race/2-0.gif]",3=>"[img=img/race/3-0.gif]",4=>"[img=img/race/4-0.gif]",5=>"[img=img/race/5-0.gif]",6=>"[img=img/race/6-0.gif]",7=>"[img=img/race/7-0.gif]",8=>"[img=img/race/8-0.gif]",10=>"[img=img/race/10-0.gif]",11=>"[img=img/race/11-0.gif]");
    

    for race 1 = img/race/1-0.gif this is the male image. how i can make it to show the female image witch is 1-1.gif if the characters is female?

    thanks. hope you guys may help me!

    or if you have other players online script. and you want to share it will me it will be cool.

    thanks again.

  2. Hi i've created a script for a staff list, and it looks like this. This is for root admin.

    but i have a problem. please take a look at my script :

    <?PHP
    require_once ( 'config.php');
    
    mysql_connect ("$host","$user","$pass");
    mysql_select_db ("$mangosrealm");
    
    $result = mysql_query ("SELECT username FROM account WHERE gmlevel > 3 ORDER BY USERNAME)");
    
    while ( $row = mysql_fetch_array($result))
    {
     $t_name = $row['username'];
       echo "
    
    [b]<span style='color: #B00000'>$t_name[/b]</span></p>";
    }
    
    ?>  
    
    

    the error is :

    Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in staff.php on line 123

    at line 123 is :

    while ( $row = mysql_fetch_array($result))

    Ps. this is the whole script, so if you wonder why at 123 lines, i have other things in the staff.php page ..

    help pls ??:D

  3. I have solved the problem.. the script is here.

                                        <?PHP                            
    
    require_once ('config.php');
    
    mysql_connect ("$host","$user","$pass");
    mysql_select_db ("$mangoscharacters");
    
    $result = mysql_query ("SELECT name, race, class, level, gender FROM characters WHERE online = 1");
    $num_online = mysql_num_rows($result);
    
    $class = array(1=>"[img=img/class/1.gif]",2=>"[img=img/class/2.gif]",3=>"[img=img/class/3.gif]",4=>"[img=img/class/4.gif]",5=>"[img=img/class/5.gif]",6=>"[img=img/class/6.gif]",
    
    7=>"[img=img/class/7.gif]",8=>"[img=img/class/8.gif]",9=>"[img=img/class/9.gif]",11=>"[img=img/class/11.gif]");
    $race = array(1=>"[img=img/race/1-0.gif]",2=>"[img=img/race/2-0.gif]",3=>"[img=img/race/3-0.gif]",4=>"[img=img/race/4-0.gif]",5=>"[img=img/race/5-0.gif]",6=>"[img=img/race/6-0.gif]",7=>"[img=img/race/7-0.gif]",8=>"[img=img/race/8-0.gif]",10=>"[img=img/race/10-0.gif]",11=>"[img=img/race/11-0.gif]");
    $gender = array(0=>"Male",1=>"Female");
    
    if($num_online < 1) {
     echo "<tr><td colspan='4' align='center'>No Players Online!</td></tr>";
    }
    
    for($i=0; $i<$num_online; $i++) {
     $row = mysql_fetch_array($result);
     $t_name = $row['name'];
     $t_race = $row['race'];
     $t_class = $row['class'];
     $t_lvl = $row['level'];
     $t_gender = $row['gender'];
     echo "
    
    $t_name";
     echo "  $race[$t_race]";
     echo "  $class[$t_class]";
     echo "  $t_lvl";
     echo "  $gender[$t_gender]</p>";
    }
    
    ?>

    * I have added

    </p>

  4. Hi guys. i have a problem.

    Players online script show something like this

    Name lvl className lvl className lvl class.

    how i can make it to show like this

    Name lvl class

    Name lvl class

    Name lvl class

    Here is an example on how it looks atm

    Admin 80 RogueGamemaster 80 MageModerator 80 Warlock

    If i want to look like this :

    Admin 80 Rogue

    GameMaster 80 Mage

    Moderator 80 Warlock

    The script i use :

                                        <?PHP                            
    
    require_once ('config.php');
    
    mysql_connect ("$host","$user","$pass");
    mysql_select_db ("$mangoscharacters");
    
    $result = mysql_query ("SELECT name, race, class, level, gender FROM characters WHERE online = 1");
    $num_online = mysql_num_rows($result);
    
    $class = array(1=>"[img=img/class/1.gif]",2=>"[img=img/class/2.gif]",3=>"[img=img/class/3.gif]",4=>"[img=img/class/4.gif]",5=>"[img=img/class/5.gif]",6=>"[img=img/class/6.gif]",
    
    7=>"[img=img/class/7.gif]",8=>"[img=img/class/8.gif]",9=>"[img=img/class/9.gif]",11=>"[img=img/class/11.gif]");
    $race = array(1=>"[img=img/race/1-0.gif]",2=>"[img=img/race/2-0.gif]",3=>"[img=img/race/3-0.gif]",4=>"[img=img/race/4-0.gif]",5=>"[img=img/race/5-0.gif]",6=>"[img=img/race/6-0.gif]",7=>"[img=img/race/7-0.gif]",8=>"[img=img/race/8-0.gif]",10=>"[img=img/race/10-0.gif]",11=>"[img=img/race/11-0.gif]");
    $gender = array(0=>"Male",1=>"Female");
    
    if($num_online < 1) {
     echo "<tr><td colspan='4' align='center'>No Players Online!</td></tr>";
    }
    
    for($i=0; $i<$num_online; $i++) {
     $row = mysql_fetch_array($result);
     $t_name = $row['name'];
     $t_race = $row['race'];
     $t_class = $row['class'];
     $t_lvl = $row['level'];
     $t_gender = $row['gender'];
     echo "$t_name ";
     echo "  $race[$t_race]";
     echo "  $class[$t_class]";
     echo "  $t_lvl";
     echo "  $gender[$t_gender]";
    }
    
    ?>

  5. pickpocketing_loot_template :
    ==================================================== 100%
    >> Loaded 6906 loot definitions (1559 templates)
    
    skinning_loot_template :
    ==================================================== 100%
    >> Loaded 2818 loot definitions (783 templates)
    
    disenchant_loot_template :
    ==================================================== 100%
    >> Loaded 80 loot definitions (37 templates)
    
    reference_loot_template :
    ==================================================== 100%
    >> Loaded 4221 loot definitions (154 templates)
    
    >>> Loot Tables loaded
    
    Loading Skill Discovery Table...
    
    >> Loaded 0 skill discovery definitions. DB table `skill_discovery_template` is
    empty.
    Loading Skill Extra Item Table...
    
    >> Loaded 0 spell specialization definitions. DB table `skill_extra_item_templat
    e` is empty.
    Loading Skill Fishing base level requirements...
    ==================================================== 100%
    >> Loaded 56 areas for fishing base skill level
    
    Loading Auctions...
    
    ==================================================== 100%
    >> Loaded 11 auction items
    
    ==================================================== 100%
    >> Loaded 11 auctions
    
    >>> Auctions loaded
    
    Loading Guilds...
    ==================================================== 100%
    >> Loaded 0 guild definitions
    
    Loading Groups...
    ==================================================== 100%
    >> Loaded 0 group definitions
    
    Loading ReservedNames...
    ==================================================== 100%
    >> Loaded 0 reserved player names
    
    Loading GameObjects for quests...
    ==================================================== 100%
    >> Loaded 436 GameObjects for quests
    
    Loading BattleMasters...
    ==================================================== 100%
    >> Loaded 24 battlemaster entries
    
    Loading BattleGround event indexes...
    ==================================================== 100%
    >> Loaded 1173 battleground eventindexes
    
    Loading GameTeleports...
    ==================================================== 100%
    >> Loaded 257 GameTeleports
    
    Loading Npc Text Id...
    ==================================================== 100%
    >> Loaded 1547 NpcTextId
    
    Loading Gossip scripts...
    gossip_scripts :
    ==================================================== 100%
    >> Loaded 0 script definitions
    
    Loading Gossip menus...
    ==================================================== 100%
    >> Loaded 738 gossip_menu entries
    
    Loading Gossip menu options...
    ==================================================== 100%
    >> Loaded 652 gossip_menu_option entries
    
    Loading Vendors...
    ==================================================== 100%
    >> Loaded 12369 Vendors
    
    Loading Trainers...
    ==================================================== 100%
    >> Loaded 27466 Trainers
    
    Loading Waypoint scripts...
    creature_movement_scripts :
    ==================================================== 100%
    >> Loaded 0 script definitions
    
    Loading Waypoints...
    
    ==================================================== 100%
    >> Paths loaded
    =Table creature_movement has waypoint for creature guid 326 (entry 1718), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 1012 (entry 705), but Mov
    ementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 3557 (entry 1199), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 3574 (entry 1135), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 3595 (entry 1125), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 3596 (entry 1199), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4360 (entry 1127), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4361 (entry 1201), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4364 (entry 1127), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4377 (entry 1196), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4378 (entry 1115), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 4522 (entry 1115), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 5459 (entry 7027), but Mo
    vementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 38347 (entry 2914), but M
    ovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 39540 (entry 2914), but M
    ovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 46818 (entry 7318), but M
    ovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 54043 (entry 14444), but
    MovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 79750 (entry 6090), but M
    ovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    Table creature_movement has waypoint for creature guid 86278 (entry 8506), but M
    ovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.
    
    >> Waypoints and behaviors loaded
    
    >>> Loaded 1496 paths, 37778 nodes and 236 behaviors
    
    
    ==================================================== 100%
    >> Loaded 0 path templates. DB table `creature_movement_template` is empty.
    
    Loading GM tickets...
    ==================================================== 100%
    >> Loaded `character_ticket`, table is empty.
    
    Returning old mails...
    ==================================================== 100%
    >> Only expired mails (need to be return or delete) or DB table `mail` is empty.
    
    
    Loading Scripts...
    
    quest_start_scripts :
    ==================================================== 100%
    >> Loaded 163 script definitions
    
    quest_end_scripts :
    ==================================================== 100%
    >> Loaded 207 script definitions
    
    spell_scripts :
    ==================================================== 100%
    >> Loaded 0 script definitions
    
    gameobject_scripts :
    ==================================================== 100%
    >> Loaded 47 script definitions
    
    event_scripts :
    ==================================================== 100%
    >> Loaded 269 script definitions
    
    >>> Scripts loaded
    
    Loading Scripts text locales...
    ==================================================== 100%
    >> Loaded 201 string templates from db_script_string
    
    Loading CreatureEventAI Texts...
    ==================================================== 100%
    >> Loaded 242 string templates from creature_ai_texts
    
    Loading EventAI Texts additional data...
    ==================================================== 100%
    >> Loaded 242 additional CreatureEventAI Texts data.
    
    Loading CreatureEventAI Summons...
    ==================================================== 100%
    >> Loaded 8 CreatureEventAI summon definitions
    
    Loading CreatureEventAI Scripts...
    ==================================================== 100%
    >> Loaded 8047 CreatureEventAI scripts
    
    Initializing Scripts...
    
    >>> Scripts Library mangosscript.dll was successfully loaded.
    
    
    ScriptDevZero [url]http://www.github.com/scriptdevzero/scriptdevzero/[/url]
    
    Fork of:
    MMM  MMM    MM
    M  MM M  M  M  M
    MM    M   M   M
    MMM  M   M  M
      MM M   M MMMM
    MM  M M  M
    MMM  MMM  [url]http://www.scriptdev2.com[/url]
    
    SD2: Using configuration file scriptdevzero.conf
    
    MySQL client library: 5.1.49
    MySQL server ver: 5.1.50-community
    SD2: ScriptDevZero database at 127.0.0.1;3306;root;Closed21;scriptdevzero initia
    lized.
    
    Loading  ScriptDevZero (for MangosZero rev. 0771+)
    
    SD2: Loading Script Texts...
    ==================================================== 100%
    >> Loaded 805 string templates from script_texts
    
    SD2: Loading Script Texts additional data...
    ==================================================== 100%
    >> Loaded 805 additional Script Texts data.
    
    SD2: Loading Custom Texts...
    ==================================================== 100%
    >> Loaded 0 string templates. DB table `custom_texts` is empty.
    
    SD2: Loading Custom Texts additional data...
    ==================================================== 100%
    >> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty.
    
    SD2: Loading Gossip Texts...
    ==================================================== 100%
    >> Loaded 0 string templates. DB table `gossip_texts` is empty.
    
    SD2: Loading Script Waypoints for 34 creature(s)...
    ==================================================== 100%
    >> Loaded 816 Script Waypoint nodes.
    
    SD2: Loading C++ scripts
    ==================================================== 100%
    >> Loaded 320 C++ Scripts.
    
    DEBUG:: Initialize game time and timers
    Starting Map System
    Starting BattleGround System
    ==================================================== 100%
    >> Loaded 3 battlegrounds
    
    Loading Transports...
    ==================================================== 100%
    >> Loaded 8 transports
    
    Deleting expired bans...
    Starting objects Pooling system...
    Pool handling system initialized, 0 pools spawned.
    Starting server Maintenance system...
    Loading Honor Standing list...
    
    >> Loaded 0 Horde and 0 Ally honor standing definitions
    Starting Game Event system...
    GameEvent 5 "Darkmoon Faire (Mulgore)" started.
    GameEvent 26 "Brewfest" started.
    GameEvent 30 "Edge of Madness, Hazza'rah" started.
    Next game event check in 564 seconds.
    Game Event system initialized.
    Player::DeleteOldChars: Deleting all characters which have been deleted 30 days
    before...
    WORLD: World initialized
    mangosd process priority class set to HIGH
    
    
    mangos>Max allowed socket connections 4096
    Table `command` have unexpected subcommand 'fly' in command 'modify fly', skip.
    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer
    spell list.
    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer
    spell list.
    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer
    spell list.
    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer
    spell list.
    GameEvent 16 "Gurubashi Arena Booty Run" started.
    Next game event check in 7200 seconds.
    WORLD: Enemy Creature (Entry: 10162 Guid: 151432) is friendly
    SESSION: received unexpected opcode CMSG_GUILD_ROSTER (0x0089) the player has no
    t logged in yet
    
    

    Wtf is happening? it crashed again.

    Man i am not so good at this, but maybe i am right. and maybe you know what i am going to say but:

    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer

    spell list.

    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer

    spell list.

    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer

    spell list.

    Creature 151607 (Entry: 14401) have UNIT_NPC_FLAG_TRAINER but have empty trainer

    spell list.

    >> Loaded 0 string templates. DB table `gossip_texts` is empty.

    and other errors with 'empty'.. the problem should be from the world db.

    try to reimport the world db or something.

  6. ok so i use

    <?php
    /*
    Very important! You need to run SQL update!
    ALTER TABLE `account` ADD `reset_password` VARCHAR( 50 ) NOT NULL;
    */
    /*Config*/
    $realmd = array(
    'db_host'=> 'localhost', //ip of db realm
    'db_username' => 'username',//realm user
    'db_password' => 'password',//realm password
    'db_name'=> 'realmd',//realm db name
    );
    $config = array(
    'path_to_thisfile' => 'link', // Example: [url]http://mysite.com/lol/ownage/wow/[/url]
    'email_from' => 'email', // Who should the email be sent from ?
    'email_subject' => 'Pass recover ', // Subject of the mail ??
    );
    
    
    
    function sha_password($user,$pass){
    $user = strtoupper($user);
    $pass = strtoupper($pass);
    
    return SHA1($user.':'.$pass);
    }
    function random_string($counts){
    $str = "abcdefghijklmnopqrstuvwxyz";//Count 0-25
    for($i=0;$i<$counts;$i++){
    if ($o == 1){
    $output .= rand(0,9);
    $o = 0;
    }else{
    $o++;
    $output .= $str[rand(0,25)];
    }
    
    }
    return $output;
    }
    
    
    $realmd_bc_new_connect = mysql_connect($realmd[db_host],$realmd[db_username],$realmd[db_password]);
    $selectdb = mysql_select_db($realmd[db_name],$realmd_bc_new_connect);
    
    if ($_GET[h] && $_GET[h] != '' && $_GET[h] != '0'){
    $output_random_pass = random_string(10);
    $query = mysql_query("SELECT username FROM `account` WHERE reset_password='$_GET[h]'");
    $res = mysql_fetch_array($query);
    if (mysql_num_rows($query) == 1){
    echo "Hi $res[username], Your password is: $output_random_pass. Please change your password fast as possible.";
    $pass_hash = sha_password($res[username],$output_random_pass);
    mysql_query("UPDATE `account` SET sha_pass_hash='$pass_hash' WHERE reset_password='$_GET[h]'");
    mysql_query("UPDATE `account` SET reset_password='' WHERE username='$res[username]'");
    }else{
    echo "Error.";
    }
    
    }else{
    ?>
    
    <?php
    //this is where user fill in and send by email
    if ($_POST[password_takeback]){
    $check_security = mysql_query("SELECT id FROM `account` WHERE username='$_POST[username]' AND email='$_POST[email]'");
    if (isset($_POST['username']) && isset($_POST['email']) && mysql_num_rows($check_security) == 1){
    $rand = random_string(40);
    mysql_query("UPDATE `account` SET reset_password='$rand' WHERE username='$_POST[username]'");
    $to = $_POST["email"];
    $from = "From: $config[email_from]";
    $subject = $config[email_subject];
    $message= "Hi $_POST[username], you have submitted a password recovery on our site. IF YOU DIDNT SUBMIT A PASSWORD REQUEST JUST DELETE THIS MAIL!. Please follow this link to complete the operation: $config[path_to_thisfile]?h=$rand";
    mail($to, $subject, $message, $from); // This work if you have configured your php.ini file to send email, !on linux its default.
    echo "An Email has been sent to you, please follow the email to complete the process.";
    }else{
    echo "Incorrect details, Please be sure that you submitted right Email and Username to your account";
    }
    }else{
    ?>
    <form action="<?php echo $_SERVER[php_SELF]; ?>" method="POST">
    
    
    Your Email:
     <input type="text" name="email">
       </p>
    
    
    Your Username:
     <input type="text" name="username">
     </p>
    
    
    
    
       <input type="submit" name="password_takeback" value="Recover Password">
     </p>
    </form>
    <?php
    }
    }// End GET
    ?>

    after i get the mail, i acces the link. and it says.. your new password is Mangos. Please change your password as soon as possible.

    (mangos is an example)

    When i try to login with the pass mangos. it dosent work. it says incorect password.

    when i try to login with the old pass, it works.

    so somewhere in the query of mysql something is bad.

    the new password dosent change the old one..

    so the old one remains.

  7. thanks

    But i found another problem.

    The password recover script dosen't rest the password.

    You get the new password. but you cannot log with it..the old password still works..

    The script i use

     <?php
    /*
    Very important! You need to run SQL update!
    ALTER TABLE `account` ADD `reset_password` VARCHAR( 50 ) NOT NULL;
    */
    /*Config*/
    $realmd = array(
    'db_host'=> 'localhost', //ip of db realm
    'db_username' => 'username',//realm user
    'db_password' => 'password',//realm password
    'db_name'=> 'realmd',//realm db name
    );
    $config = array(
    'path_to_thisfile' => 'link', // Example: [url]http://mysite.com/lol/ownage/wow/[/url]
    'email_from' => 'email', // Who should the email be sent from ?
    'email_subject' => 'Pass recover ', // Subject of the mail ??
    );
    
    
    
    function sha_password($user,$pass){
    $user = strtoupper($user);
    $pass = strtoupper($pass);
    
    return SHA1($user.':'.$pass);
    }
    function random_string($counts){
    $str = "abcdefghijklmnopqrstuvwxyz";//Count 0-25
    for($i=0;$i<$counts;$i++){
    if ($o == 1){
    $output .= rand(0,9);
    $o = 0;
    }else{
    $o++;
    $output .= $str[rand(0,25)];
    }
    
    }
    return $output;
    }
    
    
    $realmd_bc_new_connect = mysql_connect($realmd[db_host],$realmd[db_username],$realmd[db_password]);
    $selectdb = mysql_select_db($realmd[db_name],$realmd_bc_new_connect);
    
    if ($_GET[h] && $_GET[h] != '' && $_GET[h] != '0'){
    $output_random_pass = random_string(10);
    $query = mysql_query("SELECT username FROM `account` WHERE reset_password='$_GET[h]'");
    $res = mysql_fetch_array($query);
    if (mysql_num_rows($query) == 1){
    echo "Hi $res[username], Your password is: $output_random_pass. Please change your password fast as possible.";
    $pass_hash = sha_password($res[username],$output_random_pass);
    mysql_query("UPDATE `account` SET sha_pass_hash='$pass_hash' WHERE reset_password='$_GET[h]'");
    mysql_query("UPDATE `account` SET reset_password='' WHERE username='$res[username]'");
    }else{
    echo "Error.";
    }
    
    }else{
    ?>
    
    <?php
    //this is where user fill in and send by email
    if ($_POST[password_takeback]){
    $check_security = mysql_query("SELECT id FROM `account` WHERE username='$_POST[username]' AND email='$_POST[email]'");
    if (isset($_POST['username']) && isset($_POST['email']) && mysql_num_rows($check_security) == 1){
    $rand = random_string(40);
    mysql_query("UPDATE `account` SET reset_password='$rand' WHERE username='$_POST[username]'");
    $to = $_POST["email"];
    $from = "From: $config[email_from]";
    $subject = $config[email_subject];
    $message= "Hi $_POST[username], you have submitted a password recovery on our site. IF YOU DIDNT SUBMIT A PASSWORD REQUEST JUST DELETE THIS MAIL!. Please follow this link to complete the operation: $config[path_to_thisfile]?h=$rand";
    mail($to, $subject, $message, $from); // This work if you have configured your php.ini file to send email, !on linux its default.
    echo "An Email has been sent to you, please follow the email to complete the process.";
    }else{
    echo "Incorrect details, Please be sure that you submitted right Email and Username to your account";
    }
    }else{
    ?>
    <form action="<?php echo $_SERVER[php_SELF]; ?>" method="POST">
    
    
    Your Email:
     <input type="text" name="email">
       </p>
    
    
    Your Username:
     <input type="text" name="username">
     </p>
    
    
    
    
       <input type="submit" name="password_takeback" value="Recover Password">
     </p>
    </form>
    <?php
    }
    }// End GET
    ?>

  8. Hi, i have a problem..

    I have created the next script for a staff page.. where it should show all the staff names.

    the script look's like this.

                                      <?PHP
    require_once ( 'config.php');
    
    mysql_connect ("$host","$user","$pass");
    mysql_select_db ("$mangoscharacters");
    
    $result = mysql_query ("SELECT name FROM characters WHERE account IN (SELECT id FROM $mangosrealm.account WHERE gmlevel > 3 ORDER BY NAME)");
    {
     $row = mysql_fetch_array($result);
     $t_name = $row['name'];
       echo "[b]<span style='color: #B00000'>$t_name[/b]</span>";
    }
    
    ?>   

    But i have a problem. if two staff persons have the same level ( ex 4)

    the script will show just one..

    How i can make ti show all?

    I mean if 3 players have gm level 4 to show all 3 players.. not just one..

    thanks.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use