zoukankan      html  css  js  c++  java
  • 捕获php请求内容

    通过将phpinfo()打印到文件实现

    <?php
    
    echo str_pad('', 1024);//使缓冲区溢出
    ob_start();//打开缓冲区
    phpinfo();
    $string = ob_get_contents();//获取缓冲区内容
    
    $myfile = fopen("phpinfo.html", "w") or die("Unable to open file!");
    fwrite($myfile, $string);
    fclose($myfile);
    
    ob_end_clean();//清空并关闭缓冲区
    ?>

    获取CURLOPT_POSTFIELD的内容 用file_get_contents("php://input")

    <?php
    
    $myfile = fopen('upload_files/'.$_REQUEST['file_id'], "w") or die("Unable to open file!");
    fwrite($myfile, file_get_contents("php://input"));
    fclose($myfile);
    
    ?>
  • 相关阅读:
    poj 2443
    codeforces 263D
    codeforces 263C
    uva 11080
    uva 11235
    uva 11748
    STL uva 11991
    (KM) uva 11383
    (树形DP) uva 10859
    codeforces 242C
  • 原文地址:https://www.cnblogs.com/manhua/p/4571688.html
Copyright © 2011-2022 走看看