- strstr: documentation ( source)
- fsockopen: documentation ( source)
- fclose: documentation ( source)
- feof: documentation ( source)
- fgets: documentation ( source)
- fwrite: documentation ( source)
<?php
$xml='Test';
$posts='xml='.$xml;
$query="POST /index.php HTTP/1.0\r\n".
"Accept: text/html, application/xml;q=0.9, application/xhtml+xml\r\n".
"Accept-Charset: utf-8\r\n".
"Content-Type: application/x-www-form-urlencoded\r\n".
"Content-Length: ".strlen($posts)."\r\n\r\n".$posts."\r\n\r\n";
$socket=fsockopen('colesa.ru',80,$errno,$errstr,60);
fwrite($socket,$query);
while(!feof($socket)){
$s.=fgets($socket);
}
$s=strstr($s,'<html>');
fclose($socket);
echo $s;
?>
<html>
<body>
<textarea cols="60" rows="10"><? echo $_POST['xml']; ?></textarea>
</body>
</html>