>WEB系统
<?php
$handle = fopen("/tmp/inputfile.txt", "r");
while (!feof($handle)) {
    $buffer = fgets($handle, 4096);
    echo $buffer;
}
fclose($handle);
?> 
系统是SocketServer
<?php
$fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: www.example.com\r\n";
    $out .= "Connection: Close\r\n\r\n";    fputs($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
?>

解决方案 »

  1.   

    copy("http://www.example.com/aa.php", "aa.txt");
    好像也可以
      

  2.   

    楼上的写法过时了<?PHP
    echo "显示另一个页的内容:<br>";
    echo file_get_contents("http://www.php.net/manual/zh/function.file-get-contents.php");
    ?>
      

  3.   

    非常感谢wubai250(wubai)
    我运行上面所说的第二部分(系统是SocketServer)后的提示:
    HTTP/1.1 302 Moved Temporarily Content-Type: text/html Date: Thu, 18 Mar 2004 05:51:44 GMT Server: Apache Tomcat/4.0.3 (HTTP/1.1 Connector) Transfer-Encoding: chunked Location: http://127.0.0.1:8080/index.html 287 我的JSP页面在http://127.0.0.1:8080/test/message.jsp
    要怎么写才行呢?另外问个跟PHP无关的问题,如果是ASP调用JSP或Socketserver的话,有没有简便的方法?
      

  4.   

    TO:platinum(代号 铂)你说得对啊你把那个函数拿到中国万纲上就知道了,它根本不支持最新的东西
      

  5.   

    TO;xuphone(xuphone) 请参照下面的语法resource fsockopen ( string target, int port [, int errno [, string errstr [, float timeout]]])