Teraz dam tutaj cały skrypt...
Cytat
<?php
ob_start();
include ('shop/kod.php');
$account=$_SESSION["acc"];
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($account == "111111" || $account == "1")
{ $error='Dla bezpieczeństwa ten numer jest zablokowany!'; }
elseif (empty($account))
{ $error='Podaj Numer Konta!'; }
elseif (!is_numeric($account))
{ $error='Numer konta może składać się wyłącznie z cyfr!'; }
if (empty($error)) {
$query=mysql_query('SELECT * FROM accounts WHERE (id = '.$account.')');
if (mysql_num_rows($query) == 0) {
$error= "Numer nie istnieje";
}
}
$query2 = mysql_query("SELECT `bonus` FROM `accounts` WHERE (`id` = '$account') ") or die(mysql_error());
while($sql = mysql_fetch_array($query2)) {
$b = $sql['bonus'];
$add = "$punkty";
$bonus = $add + $b; //ilosc bonusu
}
$check = $_POST['check'];
$account=$_SESSION["acc"];
$id = "$id";
$code = "$usluga";
$type = "sms";
$del="1";
$handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=".$type."&del=".$del."", "r");
$status = fgets($handle, 8);
fclose($handle);
if(!isset($error))
{
if (empty($check))
{
$error = "Proszę wpisać kod dostępu!";
}
elseif ($status == 0)
{
$error = "Wpisany kod jest niepoprawny lub był już wykorzystany!";
}
else
{
$Sql = "UPDATE accounts SET bonus = '$bonus' WHERE (id = '$account')";
if (!$Result = mysql_query($Sql)) {
echo "Error at updateing.<br/>\n";
echo "Error is: <b>" . mysql_error() . "</b><br/>\n";
echo "Error in SQL: <b>" . $Sql . "</b><br/>\n";
die();
} else {
$data = date("U");
mysql_query("INSERT INTO archiwum(user, kod, data, typ) values('$account', '$check', '$data', '1')");
echo "<p>Dodano punkty.Obecna ilość:";
echo "<b>$bonus</b></p>";
}
}
}
if(isset($error)) {
echo '<h1>Błąd!</h1>';
echo '<p>'.$error.'</p>';
}}
?>
ob_start();
include ('shop/kod.php');
$account=$_SESSION["acc"];
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($account == "111111" || $account == "1")
{ $error='Dla bezpieczeństwa ten numer jest zablokowany!'; }
elseif (empty($account))
{ $error='Podaj Numer Konta!'; }
elseif (!is_numeric($account))
{ $error='Numer konta może składać się wyłącznie z cyfr!'; }
if (empty($error)) {
$query=mysql_query('SELECT * FROM accounts WHERE (id = '.$account.')');
if (mysql_num_rows($query) == 0) {
$error= "Numer nie istnieje";
}
}
$query2 = mysql_query("SELECT `bonus` FROM `accounts` WHERE (`id` = '$account') ") or die(mysql_error());
while($sql = mysql_fetch_array($query2)) {
$b = $sql['bonus'];
$add = "$punkty";
$bonus = $add + $b; //ilosc bonusu
}
$check = $_POST['check'];
$account=$_SESSION["acc"];
$id = "$id";
$code = "$usluga";
$type = "sms";
$del="1";
$handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=".$type."&del=".$del."", "r");
$status = fgets($handle, 8);
fclose($handle);
if(!isset($error))
{
if (empty($check))
{
$error = "Proszę wpisać kod dostępu!";
}
elseif ($status == 0)
{
$error = "Wpisany kod jest niepoprawny lub był już wykorzystany!";
}
else
{
$Sql = "UPDATE accounts SET bonus = '$bonus' WHERE (id = '$account')";
if (!$Result = mysql_query($Sql)) {
echo "Error at updateing.<br/>\n";
echo "Error is: <b>" . mysql_error() . "</b><br/>\n";
echo "Error in SQL: <b>" . $Sql . "</b><br/>\n";
die();
} else {
$data = date("U");
mysql_query("INSERT INTO archiwum(user, kod, data, typ) values('$account', '$check', '$data', '1')");
echo "<p>Dodano punkty.Obecna ilość:";
echo "<b>$bonus</b></p>";
}
}
}
if(isset($error)) {
echo '<h1>Błąd!</h1>';
echo '<p>'.$error.'</p>';
}}
?>