为什么种不了COOKIE 过来看看啊!新手勿扰
时间:2011-10-03
来源:互联网
- <?php
- function wfopen($url,$post='',$cookie='',$timeout=30) {
- $matches = parse_url($url);
- $out = "POST {$matches['path']} HTTP/1.0\r\n";
- $out .= "Accept: */*\r\n";
- $out .= "Accept-Language: zh-cn\r\n";
- $out .= "Content-Type: application/x-www-form-urlencoded\r\n";
- $out .= "User-Agent: $_SERVER[HTTP_USER_AGENT]\r\n";
- $out .= "Host: {$matches['host']}\r\n";
- $out .= 'Content-Length: '.strlen($post)."\r\n";
- $out .= "Connection: Keep-Alive\r\n";
- $out .= "Cache-Control: no-cache\r\n";
- $out .= "Cookie: $cookie\r\n\r\n";
- $out .= $post;
- $socket = @fsockopen($matches['host'],80,$errno,$errstr,$timeout) or die("$errstr($errno)");
- @fwrite($socket,$out);
- $header = $data = "";
- while($infos = trim(fgets($socket,4096))) {
- $header.=$infos;
- }
- while(!feof($socket)) {
- $data .= fgets($socket,4096);
- }
- return $data;
- }
- echo wfopen('http://localhost/te.php','id=5');
- ?>
-
- <?php
- if(!empty($_POST['id'])) {
- echo setcookie('clientAuth','123',time()+3600,'/') ? 1 : 0 ;
- }
作者: haowei4032 发布时间: 2011-10-03
顶一下!
作者: haowei4032 发布时间: 2011-10-03
回复 haowei4032
没人我就再顶
没人我就再顶
作者: haowei4032 发布时间: 2011-10-03
回复 haowei4032
还是没有人来帮忙呀!
还是没有人来帮忙呀!
作者: haowei4032 发布时间: 2011-10-03
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28