If you wanna make an site here is an code for it, it bans the account by putting in the character name
Code:
<?php
$DBhost = 'Your host here';
$DBUser = 'Your sa here';
$DBPass = 'Your Pass here';
$DB = 'Your DB Name Here';
//Dont change any thing belowe this!!!!
function anti_injection($anti)
{
$anti = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$anti);
return $anti;
}
function valida($camp){
foreach($camp as $lol){
if(empty($lol)){
echo "Complete all textboxs.";
return false;
}else{
return true;
}
}
}
?>
<tr>
<td bordercolor="#FF6633"><FORM METHOD=POST ACTION="<?php echo $_SERVER['PHP_SELF']; ?>?act=banchar">
Character:
<input name="char" type="text" id="char" />
<input type="submit" name="SubmitBan" value="Submit Ban" />
</form> </td>
</tr>
<tr>
<?php
// <td width="730" bordercolor="#FF6633">Results: ; </td>
$conn = mssql_connect($DBhost, $DBUser, $DBPass);
$conn2 = mssql_select_db($DB); ?>
<?php
if ($_GET['act'] == 'banchar')
{
$char = anti_injection($_POST['char']);
if (valida(Array($char)) == true)
{
$query = mssql_query("SELECT AID FROM Character WHERE Name='$char'");
if(mssql_num_rows($query)<1){
echo "Character Dosent Exist";
} else {
$data = mssql_fetch_assoc($query);
$aid = $data['AID'];
$query2 = mssql_query("UPDATE Accounts SET UGradeID='253' WHERE AID='$aid'");
$log = "La cuenta del character $char ha sido baneada.";
$ip = $_SERVER['REMOTE_ADDR'];
$fecha = date("d-m-y - H:i ");
$fileb = fopen("log.txt","r");
$escrito= fread($fileb,1000000);
$file = fopen("log.txt","w+");
$total= "$fecha - $ip: $log
\n\n$escrito";
fwrite($file,$total, 1000000);
fclose($fileb);
fclose($file);
echo "Account of $char is banned!";
}
}
}
?></td>
Credits for the most of the parts to Emisand, i took some of the admin panel ;)