Hi people,

I've got some problem with both cgi and modperl.
when I post something to /perl/test.pl which just print header and a string I got some strange numbers. The post is done with a php script.

test.pl :

use strict;
use CGI qw/:standard/;

print header;
print("\ncoucou\n");

and below is the response the php script got :

HTTP/1.1 200 OKDate: Tue, 19 Jun 2007 21:39:55 GMTServer: Apache/2.2.3 (Ubuntu) mod_ssl/2.2.3 OpenSSL/0.9.8c mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8Connection: closeTransfer-Encoding: chunkedContent-Type: text/html; charset=ISO-8859-18coucou0

It got 8coucou0 instead of coucou.

The issue is that I can't modify the php script which works for other customers and this script can't do what it has to because of these two more numbers in the response.

for guys who speak php here is the code that post data to /perl/test.pl :

$fd = fsockopen("ssl://".$this->server,443, $errno,$errstr, 60) or die("No way to open");
fputs($fd, "POST /perl/test.pl HTTP/1.1\r\n");
fputs ($fd, "Host: ".$this->server."\r\n");
fputs($fd, "Content-type: application/x-www-form-urlencoded\r\n");
fputs ($fd, "Content-length: ".strlen ($fluxsms)."\r\n");
fputs ($fd, "Connection: close\r\n\r\n");
fputs ($fd, $data);
$response = "";
while (!feof ($fd) )
{ $response = $response.fgets($fd, 128); }
fclose($fd);

thanks.

Reply via email to