예제 #1
0
    }
} else {
    invalid_input('Transaction ID is empty. Go back and try again.');
}
// save the transaction data to individual variables
list($pubAdd, $price, $quantity, $item, $seller, $success_url, $cancel_url, $note, $baggage) = explode('|', $_SESSION['t_data']);
// check for errors in price and quantity
if (empty($price) || !is_numeric($price) || empty($quantity) || !is_numeric($quantity)) {
    invalid_input('Error calculating item price. Go back and try again.');
}
// get the total price
if (empty($_SESSION['total_price'])) {
    $_SESSION['total_price'] = $price * $quantity;
}
// check for errors in address
if (!bitcoin::checkAddress($pubAdd)) {
    invalid_input('Invalid bitcoin address. Go back and try again.');
}
// success? confirm for a 2nd time then redirect
if (isset($_GET['success'])) {
    $check_result = bitsci::check_payment($_SESSION['total_price'], $pubAdd, $confirm_num);
    if ($check_result === true) {
        //change mysql to btc verified inhand
        //MYSQL CONNECT
        $con = mysql_connect($mysvr, $myusr, $mypass);
        if (!$con) {
            die('Could not connect: ' . mysql_error());
        }
        mysql_select_db($mydb) or die(mysql_error());
        // Insert a row of information into the table "payment"
        mysql_query("INSERT INTO payment \n(inhand) VALUES('YES') ") or die(mysql_error());