Poczytałem sobie
to.
Piszę w pliku try.php:
<?php
function doPost($uri,$postdata,$host){
if (!$da) {
echo "$errstr ($errno)<br/>n"; }
else {
$salida ="POST $uri HTTP/1.1rn";
$salida.="Host: $hostrn";
$salida.="User-Agent: php Scriptrn";
$salida.="Content-Type: application/x-www-form-urlencodedrn";
$salida.="Content-Length: ".strlen($postdata)."rn"; $salida.="Connection: closernrn";
$salida.=$postdata;
$response.=fgets($da, 128
); $response=split("rnrn",$response); $header=$response[0];
$responsecontent=$response[1];
if(!(strpos($header,"Transfer-Encoding: chunked")===false)){ $aux=split("rn",$responsecontent); for($i=0;$i<count($aux);$i++)
if($i==0 || ($i%2==0))
$aux[$i]="";
}//if
return chop($responsecontent); }//else
}//function-doPost
doPost('catch.php','dana1=tomek','localhost')
?>
oraz plik catch.php:
<?
?>
I nie działa, nie wyświetla żadnych danych :/
Co robię źle?
Chciałbym wysłać do serwera zewnętrznego dane postem....
Dzięki