hi there,
got a big problem sending HTTP_POST_VARS to an php-file outputting an pdf-file to the browser
how it should work:
at the first file (query.php) i get the data from the DB aund build an array from the data
then i try to send the array as POST (see code)
$request.="POST ".$URL_Info["path"]." HTTP/1.1\n";
$request.="Host: ".$URL_Info["host"]."\n";
$request.="Referer: $referer\n";
$request.="User-Agent: $agent\n";
$request.="Content-type: application/x-www-form-urlencoded\n";
$request.="Content-length: ".strlen($POST_string)."\n";
$request.="Connection: close\n";
$request.="\n";
$request.=$POST_string."\n";
$fp = fsockopen($URL_Info["host"],$URL_Info["port"],&$error1,&$error2);
fputs($fp, $request);
$key="HEAD";
while(!feof($fp)) {
$tmp=fgets($fp, 128);
if($key=="HEAD" && trim($tmp)=="")
$key="BODY";
$result[$key][] =$tmp;
unset($tmp);
}
fclose($fp);
after this i have i file building an pdf to the buffer, which should be displayed as pdf
(see code)
$pdf = build_pdf($HTTP_POST_VARS["test"], $pdf_name="");
header("Content-Type: application/pdf");
header("Content-Length: " . strlen($pdf));
header("Content-Disposition: inline; filename=". $pdf_name);
echo $pdf;
exit;
, what i can say the POST works and the pdf will be created but does'nt work together
what to do??