/*将收到的POST数据,写入文本 要求用telnet来请求*/
php代码:
<?php
$str=implode($_POST,"\n");
file_put_contents('./post.txt',$str);
print_r($str);
?>
通过telnet传输post数据在当前文件夹下(www目录下)生成了post.txt文件,但为什么文件里没有数据呢?
php代码:
<?php
$str=implode($_POST,"\n");
file_put_contents('./post.txt',$str);
print_r($str);
?>
通过telnet传输post数据在当前文件夹下(www目录下)生成了post.txt文件,但为什么文件里没有数据呢?
解决方案 »
- unix php mail发带附件的邮件
- 网站访问一段时间之后 就会变的巨卡甚至访问不了 只要重启IIS 立刻速度变快 求助
- iphone手机应用请求post方式请求php接口时参数丢失
- 求一伪静态写法。
- 求一个简单的php判断
- 微信公众平台接口简单处理程序
- 有人做过织梦的CMS二次开发吗?
- 从数据库读取中文 乱码了
- 求助 打开页面返回页面无法显示(经常性出显)
- svn问题:Error: 请求的名称有效,但是找不到请求的类型的数据。
- wordpress插件好开发吗?
- imagecreatefrompng频繁调用Warning: imagecreatefrompng(): Cannot read image data
php代码:
<?php
$str=implode("\n",$_POST);
file_put_contents('./post.txt',$str);
print_r($str);
?>
telnet传输post数据post.txt文件里还是没有数据
$file = . './data/piaobo_im/simsimi_cookie.cache.php';
if ($fp = @fopen($file, 'wb')) {
@fwrite($fp, "<?php\r\nif(!defined('IN_DISCUZ')){exit('Aecsse Denied');}\r\n\$cookie='$cookie'; \r\n\r\n?>");
fclose($fp);
}
我先这样测试了一下:
<?php
$str=implode("\n",$_POST);
file_put_contents('./post.txt',$str);
print_r($str);
$file = './data/piaobo_im/simsimi_cookie.cache.php';
if ($fp = @fopen($file, 'wb')) {
@fwrite($fp, "<?php\r\nif(!defined('IN_DISCUZ')){exit('Aecsse Denied');}\r\n\$cookie='$cookie'; \r\n\r\n?>");
fclose($fp);
?>
测试成功然后又这样测试了一下
<?php
$str=implode("\n",$_POST);
file_put_contents('./post.txt',$str);
print_r($str);
?>
测试也成功了我想问一下这段代码是什么意思啊
$file = './data/piaobo_im/simsimi_cookie.cache.php';
if ($fp = @fopen($file, 'wb')) {
@fwrite($fp, "<?php\r\nif(!defined('IN_DISCUZ')){exit('Aecsse Denied');}\r\n\$cookie='$cookie'; \r\n\r\n?>");
fclose($fp);simsimi_cookie.cache.php是cookie缓存文件什么的吗?
<?php\r\nif(!defined('IN_DISCUZ')){exit('Aecsse Denoied');}\r\n\$cookie='$cookie'; \r\n\r\n?>这个又是什么呢?