<script language="Javascript"><!-- Begin
document.oncontextmenu = function(){return false}
// End -->
</script>
<? include("Includes/Config.php"); ?>
<?
$queryString = strtolower($_SERVER['QUERY_STRING']);
if (strstr($queryString,"<") OR strstr($queryString,">") OR strstr($queryString,"(") OR strstr($queryString,")") OR
strstr($queryString,"..") OR
strstr($queryString,"%") OR
strstr($queryString,"*") OR
strstr($queryString,"+") OR
strstr($queryString,"!") OR
strstr($queryString,"@")) {
$loc = $_SERVER['PHP_SELF'];
$ip = $_SERVER['REMOTE_ADDR'];
$date = date ("d-m-Y @ h:i:s");
$lfh = "log.txt";
$lfh = "credits.php";
$log = fopen ( $lfh,"a+" );
fputs ($log, "Attack Date: $date | Attacker IP: $ip | QueryString: $loc?=$queryString\n");
fclose($log);
echo "You think you can hack me? Now You will eat the BANN!!";
}
?>
<center>
<?
if(isset($_POST['login'])) {
$user = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_INFO WHERE memb___id='$_POST[username]' AND memb__pwd='$_POST[password]'"));
if(empty($_POST['username']) OR empty($_POST['password'])) { echo "There is some empty field"; $error=true; }
elseif(!$user) { echo "There is no such username or password is wrong"; $error=true; }
if(!$error) {
setcookie('username',$user['memb___id'],0);
setcookie('password',$user['memb__pwd'],0);
$_COOKIE['username'] = $user['memb___id'];
$_COOKIE['password'] = $user['memb__pwd'];
}
}
if(!$_COOKIE['username']) {
echo "<form method='post' action=''><center></br></br></br></br></br></br></br></br></br></br></br></br></br><strong>Please LOGIN</strong></br>
<strong>Username: </strong><input type='text' id='username' name='username' maxlength='10' /><br />
<strong>Password:</strong> <input type='password' id='password' name='password' maxlength='10' /><br />
<strong><input type='submit' id='login' name='login' value='Login'/></strong></center>
</form>"; }
else {
if(isset($_POST['submit'])) {
$char = $_POST['character'];
$resets = (int) $_POST['resets'];
$excre = 50;
$character = mssql_fetch_array(mssql_query("SELECT * FROM Character WHERE AccountID='$_COOKIE[username]' AND Name='$char'"));
$webshop = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_CREDITS WHERE memb___id='$_COOKIE[username]'"));
if(!$character) { echo "No such character"; $error=true; }
elseif(!$webshop) { echo "Login in webshop once to do this"; $error=true; }
elseif($resets <= 0 ) { echo "Add more then 1 reset"; $error=true; }
elseif($character['Resets']<$resets) { echo "Not enought resets"; $error=true; }
if(!$error) {
mssql_query("UPDATE Character SET cLevel='1',Resets='".($character['Resets']-$resets)."' WHERE AccountID='$_COOKIE[username]' AND Name='$char'");
mssql_query("UPDATE MEMB_CREDITS SET credits=credits+'".($excre*$resets)."' WHERE memb___id='$_COOKIE[username]'");
echo "You exchange $resets reset(s) for ".($excre*$resets)." credits";
}
}
$characters = mssql_query("SELECT * FROM Character WHERE AccountID='$_COOKIE[username]'");
$i = 0;
echo "<form method='post' action=''><select id='character' name='character'><optgroup label='Select a character'>";
while($chars = mssql_fetch_array($characters))
{
echo "<option value='$chars[Name]'>$chars[Name] [$chars[Resets]]</option>";
}
echo "</select>
<br />
<input type='text' id='resets' name='resets' />
<br />
<input type='submit' id='submit' name='submit' value='Exchange'/></form>";
$i++;
}
?></center><br><center><font color=#C47443 size="2"> Sell Your Resets For Credits !!</br></font>
<center><font color=#C47443 size="2"> <strong>1 Reset = 50 credits !!!!! </strong></font></center>