CURL echoing response when not asked to

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
exxx
Forum Newbie
Posts: 4
Joined: Mon Oct 10, 2005 3:44 pm

CURL echoing response when not asked to

Post 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]
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post 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().
exxx
Forum Newbie
Posts: 4
Joined: Mon Oct 10, 2005 3:44 pm

Post by exxx »

thanks a lot, greatly appreciated.
Post Reply