示例#1
0
  <br/><br/>
  <p>You are buying <b><?php 
echo $quantity;
?>
 x <?php 
safe_echo($item);
?>
 @ <?php 
echo $price;
?>
 BTC</b> from <b><?php 
safe_echo($seller);
?>
</b></p>
  <p>Please transfer <i>exactly</i> <b><?php 
echo bitsci::btc_num_format($_SESSION['total_price']);
?>
 BTC</b> to the following address:</p>
  
  <h3>
    <b><?php 
echo '<a href="bitcoin:' . $pubAdd . '?amount=' . $_SESSION['total_price'] . '" title="Click this address to launch your Bitcoin client" target="_blank">' . safe_str($pubAdd) . '</a>';
?>
</b>
  </h3> 
  <div id="qrcode"></div>
  
  <?php 
if (empty($_GET['u'])) {
    ?>
 
示例#2
0
 // form encrypted key data
 $encWIF = bin2hex(bitsci::rsa_encrypt($keySet['privWIF'], $pub_rsa_key));
 $key_data = $encWIF . ':' . $keySet['pubAdd'];
 // set up sci variables
 $price = rawurldecode($_GET['btc']);
 $item = rawurldecode($_GET['item']);
 $quantity = 1;
 $note = rawurldecode($_GET['notes']);
 $buyer = rawurldecode($_GET['buyer']);
 $seller = rawurldecode($_GET['seller']);
 $frpin = rawurldecode($_GET['pin']);
 $vpin = rawurldecode($_GET['vpin']);
 $baggage = 'null';
 $pubAdd = $keySet['pubAdd'];
 $privwif = $keySet['privWIF'];
 $_SESSION['total_price'] = bitsci::btc_num_format($price * $quantity);
 $privkey = $key_data;
 // generate unique random string
 $random_str = bitcoin::randomString(26);
 while (file_exists('t_data/' . $random_str)) {
     $random_str = bitcoin::randomString(26);
 }
 //send data to mysql
 //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(price, quantity, item, seller, buyer, note, baggage, key_data, pubAdd, privwif, privkey, frpin, buyrel, verifypin) VALUES('{$price}', '{$quantity}', '{$item}', '{$seller}', '{$buyer}', '{$note}', '{$baggage}', '{$key_data}', '{$pubAdd}', '{$privwif}', '{$privkey}', '{$frpin}', 'NO', '{$vpin}') ") or die(mysql_error());