title: Warning: curl_setopt() expects parameter 2 to be long, string given in /home/crevisio/public_html/matisoff.info/white/coinbase/payment.php on line 7
body: <p>What's wrong with this code?</p>
  
  <p>Idk why but the formatting is messed up on here.  It's the line:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  </code></pre>
  
  <p>I'm new here and all help is appreicated.  Thanks.</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['payment'])){
      require('config.php');
      $ch= curl_init('https://coinbase.com/api/v1/account/generate_receive_address');
      $amount=$_POST['amount'];
      $json=json_encode(array("api_key"=&gt;COINBASE_APIKEY,"address"=&gt;array("callback_url"=&gt;$_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']).'callback.php')));
      curl_setopt($ch, CURLOPT_HTTPHEADERS, array('Content-Type: application/json'));
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); 
      curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
      curl_setopt($ch, CURLOPT_POST, 1);
      $jsonreturn=json_decode(curl_exec($ch),true);
      if(is_integer($amount) &amp;&amp; $amount&gt;0 &amp;&amp; $jsonreturn['callback_url']==$_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']).'callback.php'){
          $mysql=new mysqli(MYSQL_HOSTNAME,MYSQL_USERNAME,MYSQL_PASSWORD,MYSQL_DATABASE);
          $mysql-&gt;query("INSERT INTO invoices(Amount, Address) VALUES ('$amount','".$jsonreturn['address']."')");
          $mysql-&gt;close();
          header('refresh: 1;url=payment.php?address='.$jsonreturn['address'].'&amp;amount='.$amount);
          exit();
      }else{
          header("refresh: url=payment.php?error=1");
          exit();
      }
  }
  ?&gt;
  </code></pre>