[PHP HELP]Race Change Script menu

User Tag List

Results 1 to 3 of 3
  1. #1
    SupernovaHH's Avatar Member
    Reputation
    12
    Join Date
    May 2008
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PHP HELP]Race Change Script

    Ok i found this race change script on AC Web and im going to use it on my site. however i need a bit of help since i've never done this before. Here's the script:

    Code:
    Ok Here is the final ^.^ Created by ProphetX And a bit eddited by me  its for mangos/Trinity if you want it for arcemu just edit the Red with the Green
    
    
    "$query = 'SELECT guid, account, name, race, class, gender FROM '.$characterTable;"
    
    "$query = 'SELECT guid, acct, name, race, class, gender FROM '.$characterTable;"
    
    
    Quote:
    Originally Posted by ghbsraziel View Post
    <?php
    /*
    PHP Race Changer
    By Prophet
    *******
    */
    $dbServer = 'serverIp'; // default localhost
    $dbUser = 'User';
    $dbPass = 'pass';
    $characterDB = 'characterdatabase';
    $characterTable = 'Charactertable';
    
    $characterLimit = '1'; //Max characters to show on the page
    
    $races = array(
    1 => "Human",
    2 => "Orc",
    3 => "Dwarf",
    4 => "Night Elf",
    5 => "Undead",
    6 => "Tauren",
    7 => "Gnome",
    8 => "Troll",
    10 => "Blood Elf",
    11 => "Draenei");
    
    $genders = array(
    0 => "Male",
    1 => "Female");
    
    
    //Connect
    $link = mysql_connect($dbServer, $dbUser, $dbPass) or die(mysql_error());
    mysql_select_db($characterDB) or die(mysql_error());
    
    if (isset($_POST['changeSubmit'])) {
    $result = mysql_query("UPDATE $characterTable SET race={$_POST['race']}, gender={$_POST['gender']} WHERE guid={$_POST['id']}") or die(mysql_error());
    if ($result) echo '<p style="color: #00CC00;">Race changed successfully</p>';
    }
    
    $query = 'SELECT guid, account, name, race, class, gender FROM '.$characterTable;
    if (isset($_GET['searchName'])) {
    $query .= " WHERE name LIKE '{$_GET['searchName']}%'";
    }
    $query .= ' LIMIT '.$characterLimit;
    
    $result = mysql_query($query) or die(mysql_error());
    ?>
    
    <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <label for="searchName">Search characters:</label> <input type="text" name="searchName" id="searchName" size="25" value="<?php echo $_GET['searchName']; ?>" /> <input type="submit" value="Search" />
    </form>
    
    <table border="1">
    <?php
    //Show the characters
    while ($row = mysql_fetch_array($result)) { ?>
    <tr>
    <form id="<?php echo $row['guid']; ?>" method="post" action="<?php echo $_SERVER['PHP_SELF']."?searchName=".$_GET['searchName']; ?>">
    <td><?php echo $row['name']; ?></td>
    <td><?php getRace($row['race']); ?></td>
    <td><?php getGender($row['gender']); ?></td>
    <td><input type="hidden" name="id" value="<?php echo $row['guid']; ?>" /><input type="submit" name="changeSubmit" value="Set Race" /></td>
    </form>
    </tr>
    <?php } ?>
    </table>
    
    
    <?php
    //Clean up
    mysql_free_result($result);
    mysql_close($link);
    
    //Function...
    function getRace($race) {
    global $races;
    $output = '<select name="race">';
    foreach ($races as $key=>$val) {
    $output .= '<option value="'.$key.'"';
    if ("$key" == "$race") {
    $output .= ' selected="selected"';
    }
    $output .= '>'.$val.'</option>';
    }
    
    $output .= '</select>';
    
    echo $output;
    return true;
    }
    
    function getGender($gender) {
    global $genders;
    $output = '<select name="gender">';
    foreach ($genders as $key=>$val) {
    $output .= '<option value="'.$key.'"';
    if ("$key" == "$gender") {
    $output .= ' selected="selected"';
    }
    $output .= '>'.$val.'</option>';
    }
    
    $output .= '</select>';
    
    echo $output;
    return true;
    }
    
    ?>
    and dont forget to thanks ProphetX!
    Now what i want to do with this is instead of SEARCHING for the characters by typing in a name. I want it to make you Log into your account and get all your characters from your account and list them. If anyone could help me with this ill +Rep you as much as i can, ill also repost it on AC Web and up here for everyone to use.

    Credits to ProphetX for making xD

    thanks in advance.

    [PHP HELP]Race Change Script
  2. #2
    AlienCCL's Avatar Active Member
    Reputation
    28
    Join Date
    Aug 2008
    Posts
    444
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    бля не проще спросить сразу же на ац веб в том же топе?)
    Yes , I sit right now in front of the monitor in a cap with ear-flaps with a balalaika, a nested doll, vodka and a comrad Lenin. And behind my window dancing bears with jingles in hands .

  3. #3
    SupernovaHH's Avatar Member
    Reputation
    12
    Join Date
    May 2008
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by AlienCCL View Post
    shit is not easy to ask immediately for a. Web in the same Top?
    What? lol i've got no idea what that even says

Similar Threads

  1. [Help] Problem with race change - voice
    By Bo1 in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 06-15-2008, 01:43 PM
  2. help with race change
    By hellfyrexxx in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 05-09-2008, 02:02 PM
  3. Race Changing Help
    By lohkies in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 08-23-2007, 03:49 PM
  4. Need help to change race
    By Kuth in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 03-27-2007, 07:07 AM
  5. Race-Race change error plz help
    By Lexan in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 02-27-2007, 10:30 AM
All times are GMT -5. The time now is 05:18 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search