捕获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); ?>