Пример #1
0
<noscript><meta http-equiv="Refresh" content="0;URL=https://ws.youpass.com/error"></noscript>
<script language="Javascript" src="https://ws.youpass.com/access_check/iGIxh7obW2/8yhKOyOzVw"></script>

<?php 
setlocale(LC_CTYPE, 'fr_FR.UTF-8');
mb_internal_encoding('UTF-8');
session_start();
include_once '../api/config.php';
include_once '../api/dev.php';
include_once '../api/fonctions.php';
include_once '../api/app.php';
$dev = new dev($mysql_hostname, $mysql_username, $mysql_password, $mysql_database);
if (isset($_SESSION['user'])) {
    if ($dev->isConnected($_SESSION['user']['username'], $_SESSION['user']['password'], $_SESSION['user']['session_id'])) {
        $dev->setBalance($dev->getId($_SESSION['user']['username']), $dev->getAccountInfo($dev->getId($_SESSION['user']['username']))['balance'] + 1);
        $dev->addShopHistory($dev->getId($_SESSION['user']['username']), "1", "money_add_shop_1");
        echo '<script type="text/javascript">window.location.href="shop_thankyou.php";</script>';
    } else {
        unset($_SESSION['user']);
        echo '<script type="text/javascript">window.location.href="shop_error.php";</script>';
    }
} else {
    echo '<script type="text/javascript">window.location.href="shop_error.php";</script>';
}