|
Posted by saddor on 11/25/06 13:53
Very simple my friend
Solution One
<?php
$host = "www.example.com";
$fp = fsockopen($host, 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
Option 2 (> PHP 4 and if the server allow) :
$file = file_get_content("http://www.example.com/test.php");
Option 3:
$f = fopen("http://www.example.com/test.php","r");
while ($r = fread($f, 1024)
print $r;
fclose($f);
Is that useful for you?
--
Cesar Rodas
http://www.phpclasses.org/grank (A PHP implementation of PageRank)
On Nov 20, 7:40 pm, Yoko <n...@na.ca> wrote:
> So I am using php version 4.3.9 and lets say i have a file on the server
> called tester.php
>
> so i am using fsockopen to point to that file but it gives me a error below.
>
> $fh = @fsockopen("http://www.mysite.com/teter.php", "80", $errno, $errstr,
> 180);
>
> 111 Connection refused
>
> This server is linux Redhat Enterprise with Apache 2.x
>
> Is there anything i need to edit in the php.ini file or apache file.
>
> Thanks...
Navigation:
[Reply to this message]
|