example:
PHP Code:
<?php
/* Silkroad Re-born Script by Deja45Vu - deja45vu@gmail.com*/
/*Connection to SQL*/
$host = "...\SQLEXPRESS";
$user = "sa";
$pass = "12345";
$Shard_DB = "SRO_VT_SHARD";
$Account_DB = "SRO_VT_ACCOUNT";
$shard = odbc_connect("Driver={SQL Server};Server={".$host."}; Database={".$Shard_DB."}", "".$user."", "".$pass."");
$account = odbc_connect("Driver={SQL Server};Server={".$host."}; Database={".$Account_DB."}", "".$user."", "".$pass."");
/* AntiSQL security */
function anti_injection($sql){
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
$sql = stripslashes($sql);
$sql = str_replace("'", "''", $sql);
return $sql;
}
/*Settings*/
$level = "110"; /* Req. Level to reset */
$to = "1"; /* Reset to ... Level */
/*Reborn script */
if(isset($_POST["submit"])){
$charName = anti_injection($_POST["charName"]);
$password = anti_injection($_POST["password"]);
$mdpassword = md5($password);
$char = odbc_exec($shard, "select * from _Char where CharName16 = '$charName'");
$info = odbc_fetch_array($char);
$charID = $info['CharID'];
$JID = odbc_fetch_array(odbc_exec($shard, "select * from _User where CharID = '$charID'"));
$user = $JID['UserJID'];
$pwd = odbc_fetch_array(odbc_exec($account, "select * from TB_User where JID = '$user'"));
if($charName == "" || $password == ""){
echo "<div class='error'>Please fill all fields</div>";
}else if(odbc_num_rows($char) == '0'){
echo "This Character does not exist";
}else if($info['CurLevel'] != $level){
echo "Character level is to low";
}else if($pwd['password'] != $mdpassword){
echo "Password is worng";
}else{
$update = odbc_exec($shard, "UPDATE dbo._Char SET CurLevel = '$to', MaxLevel = '$to' Where CharID = '$charID'");
if($update){
echo "Success";
}else{
echo "error";
}
}
}
?>
<form action="" method="post">
<table>
<tr>
<td>CharName</td> <td><input type="text" name="charName" id="charName" /> </td>
</tr>
<tr>
<td>Password</td> <td><input type="password" name="password" id="password" /> </td>
</tr>
<tr>
<td></td> <td><input type="submit" name="submit" value="Reborn" /> </td>
</tr>
</table>
</form>
Click LIKE :)