请问在flow.php文件中如何以get方式向远程URL(如http://www.site.com/url.php?user=xxx&time=XXX)提交请求
不能用JS,只能在PHP中处理

解决方案 »

  1.   

    <?php
    var_dump(file_get_contents('http://www.site.com/url.php?user=xxx&time=XXX'));
    ?>
      

  2.   

    根据file_get_contents()返回的值去判断~~
    $flag = file_get_contents();
      

  3.   


    file_get_contents('http://www.site.com/url.php?user=xxx&time=XXX') 
    //返回请求结果var_dump()
    //打印出结果
      

  4.   

    <?php
    // Create a stream
    $opts = array(
      'http'=>array(
        'method'=>"GET",
        'header'=>"Accept-language: en\r\n" .
                  "Cookie: foo=bar\r\n"
      )
    );$context = stream_context_create($opts);// Open the file using the HTTP headers set above
    $file = file_get_contents('http://www.site.com/url.php?user=xxx&time=XXX', false, $context);
    ?> //$file是你用get请求的结果, 没有值时为false
      

  5.   

    方法多了
    1、用file或file_get_contents等
    2、用CURL系列的函数
    3、用Socket系列函数
    4、用fsockopen