Hello,

I have the following problem:

I am trying to execute request using POST with chunked encoding. While I am using mod_php all is fine and the $_REQUEST superglobal is populated correctly, however when I install suPHP and start using it the $_REQUEST never gets populated with the data being submitted.

Server side script: p.php

<?
var_dump($_REQUEST);
?>

Submit script: submit.php

<?php


$qs                     = array();
$qs[]           = 'IMEI=test';
$qs[]           = 'fileData=' . file_get_contents('test.txt');

$qs                     = implode('&',$qs);

$response       = curl2('http://localhost/p.php', $qs);

print_r($response);

////////////////////////////////////////////////////////////////
function curl2($url, $post='')
{
        $rand           = rand(100000,400000);
        $agent          = "xxx";
        $ch                     = curl_init();
        $headers        = array(
                'Transfer-Encoding: chunked');

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_USERAGENT, $agent);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,  2);
        curl_setopt($ch, CURLINFO_HEADER_OUT, true);
        curl_setopt($ch, CURLOPT_HEADER, 0);

        $result = curl_exec ($ch);
        curl_close ($ch);
        return $result;
}
////////////////////////////////////////////////////////////////

?>


Any help would be greatly appreciated.

Regards,
Deyan



_______________________________________________
suPHP mailing list
[email protected]
https://lists.marsching.com/mailman/listinfo/suphp

Reply via email to