cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

help!

From: Siderite <siderite_at_go.ro>
Date: Wed, 9 Apr 2003 21:02:21 +0300

I am trying to make a PHP browser thingie. Simple enough it just looks into
a mySQL database, opens pages and replaces strings with getit.php?ID=xxx;

  I am using cURL to send POST data to the pages the the site reads.
However, the ouput of the cURL functions is completely bogus. I am reading a
file over http that is a simple text with 1 word: Costin. The cURL output is
COSTIN1. How come?
  Is there a problem with sending GET and POST data in the same time? are
there problems with CURL installed as a PHP module?

  I am using cURL 7.10.4 and PHP 4.3.1.

  Here is a transcript of the PHP source I am using:

  flush();
  ob_start();
  $ch=curl_init();
  curl_setopt($ch, CURLOPT_VERBOSE, 1);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
  curl_exec($ch);
  $page=ob_get_contents();
  ob_end_clean();
  echo curl_error($ch);
  curl_close($ch);

where $post is a string looking like this:

 a="b"&c="d"

No curl_error is reported, the POST variables seem ok, but the output of the
curl exec is garbled as hell! What's wrong? :(

-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
for complex code. Debugging C/C++ programs can leave you feeling lost and
disoriented. TotalView can help you find your way. Available on major UNIX
and Linux platforms. Try it free. www.etnus.com
Received on 2003-04-09