Monday 15 July 2013

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 -


What's wrong with this code?

Why IDC But here is the formatting error: This is the line:

  curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);   

I'm new here and all help. Thank you.

  & lt ?? Php if (isset ($ _ POST ['Payment'])) {Required ('config.php'); $ Ch = curl_init ('https://coinbase.com/api/v1/account/generate_receive_address'); $ Amount = $ _ post ['amount']; $ Json = json_encode (array ("api_key" => COINBASE_APIKEY, "address ="> array ("callback_url" = & gt; $ _ server ['HTTP_HOST']. Dirname ($ _ SERVER ['REQUEST_URI' ]). 'Callback .php'))); Curl_setopt ($ ch, CURLOPT_HTTPHEADERS, array ('content-type: application / jsn')); 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_ignier ($ amount) & amp; amp; amp; amp; amp; amp; amp; amp; amp; amount amount & gt; 0 & amp; amp; amp; $ jsonreturn ['callback_url'] == $ _ server ['http_HOST' ]. Dirname ($ _ SERVER ['REQUEST_URI']) .php ') {$ mysql = new mysqli (MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE); $ Mysql- & gt; Query ("INSERT invoice values ​​('$ amount', ''. $ Jsonreturn ['address']." ') "); $ Mysql- & gt; Pass (); Header (' Refresh: 1; url = payment.php? Address = '. $ Jsonreturn [' address']. 'And zodiac ='. $ Zodiac); Go ();} and {header ("Refresh: url = payment.php? Error = 1 "); Exit ();}}? & Gt;    

The problem is actually with the CURLOPT_HTTPHEADERS line (line number does not count the lines of PHP code only, beginning with the beginning of the file)

The actual PHP is continuous (singular) C URLOPT_HTTPHEADERS No. p> Due to the method of the undefined constraint by PHP, it generates a warning message (possibly hidden due to your configuration settings), and the form of a string The undefined constant in: "CURLOPT_HTTPHEADERS" - Thus, an error is expected about an error (long), and a string is being made.

Updated

If you still do not get results Are you expecting from your address, I'll check out the following:

  1. Your connection criteria - where the hostname, username, password, etc.? Are you sure they are right?

  2. You have not left your variable values ​​properly before entering your query. If you get quotes in your values, then instead of checking it will cause problems, try echo to resonate your code, and then try to run it against your database manually I also recommend using Excessive instead.

No comments:

Post a Comment