Page 1 of 1

CURL echoing response when not asked to

Posted: Mon Oct 10, 2005 5:08 pm
by exxx
Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Code: Select all

$URL="secure.comodo.net/products/!DecodeCSR";
$ch = curl_init();    
curl_setopt($ch, CURLOPT_URL,"http://$URL");
curl_setopt($ch, CURLOPT_POST, 1);
$_POST['csr'] = rawurlencode($_POST['csr']);
header('Content-type: text/plain; charset=UTF-8');
curl_setopt($ch, CURLOPT_POSTFIELDS, "csr=".$_POST['csr']."&showcsr=Y&product=".$_POST['product']);
$response = curl_exec ($ch);    
curl_close ($ch);

Not anywhere do I echo $response; in fact I have no echos anywhere in that .php file

However, the response is STILL being echoed!

http://s93549175.onlinehome.us/comodo/decode_csr.php (Submit the form to see the response)

How can I resolve this?

Any help is greatly appreciated,
Thanks in advance.


Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Mon Oct 10, 2005 6:44 pm
by redmonkey
http://www.php.net/curl_exec wrote: Note: If you want to have the result returned instead of it being printed to the browser directly, use the CURLOPT_RETURNTRANSFER option of curl_setopt().

Posted: Tue Oct 11, 2005 12:02 am
by exxx
thanks a lot, greatly appreciated.