[Help] Resets for credits

Firewallcho

New Member
Joined
Apr 25, 2011
Messages
323
Reaction score
111
Трябва ми форума за Resets for credits. Знам ,че го имаше някаде из форума, но нямам много време за търсене.
 
до сега да го беше намерил.
 
Code:
<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>

Някой може ли да ми направи следното:
1. Да се вижда само от потребители които са си влезли в акаунта!
2. Да се премахни login формата!
 
PHP:
<?
if($_SESSION['user'] == true)
{
$acc = secure($_SESSION['user']);
if(isset($_POST['submit'])) {
$char = $_POST['character'];
$resets = (int) $_POST['resets'];
$excre = 50;

$character = mssql_fetch_array(mssql_query("SELECT * FROM Character WHERE AccountID='$acc' AND Name='$char'"));
$webshop = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_CREDITS WHERE memb___id='$acc'"));

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='$acc' AND Name='$char'");
mssql_query("UPDATE MEMB_CREDITS SET credits=credits+'".($excre*$resets)."' WHERE memb___id='$acc'");
echo "You exchange $resets reset(s) for ".($excre*$resets)." credits";
}
}


$characters = mssql_query("SELECT * FROM Character WHERE AccountID='$acc'");
$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>
<?
}
else
{
echo "Please Login";
}
?>
ето ти скрипта работи тестван е :)
 
Има бъг в скрипта..
Когато си продадеш ресовете те прави 1 - левел и ехп-то ти е -2323232328428329
 
значи това с левела не е бъг то така трябва да е като си размениш кредитите ставаш 1 лвл а за експа нямам си и на идея защо го прави на -
 
е кажи как, може и на друг да му потрябва това (dull)
 
е кажи как, може и на друг да му потрябва това (dull)

Така:
PHP:
<?
if($_SESSION['user'] == true)
{
$acc = secure($_SESSION['user']);
if(isset($_POST['submit'])) {
$char = $_POST['character'];
$resets = (int) $_POST['resets'];
$excre = 50;

$character = mssql_fetch_array(mssql_query("SELECT * FROM Character WHERE AccountID='$acc' AND Name='$char'"));
$webshop = mssql_fetch_array(mssql_query("SELECT * FROM MEMB_CREDITS WHERE memb___id='$acc'"));

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 Resets='".($character['Resets']-$resets)."' WHERE AccountID='$acc' AND Name='$char'");
mssql_query("UPDATE MEMB_CREDITS SET credits=credits+'".($excre*$resets)."' WHERE memb___id='$acc'");
echo "You exchange $resets reset(s) for ".($excre*$resets)." credits";
}
}


$characters = mssql_query("SELECT * FROM Character WHERE AccountID='$acc'");
$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>
<?
}
else
{
echo "Please Login";
}
?>