php,curl,模拟登录
后端开发-php教程
php 使用curl模拟登录人人(校内)网的简单实例平台源码交易平台,ubuntu怎么写汇编,绿色版tomcat安装配置详解,白色爬虫有哪些,php7显示目录所有文件,wp中文seolzw
$login_url = 'http://passport.renren.com/PLogin.do'; $post_fields['email'] = 'XXXX'; $post_fields['password'] = 'XXXX'; $post_fields['origURL'] = 'http%3A%2F%2Fhome.renren.com%2FHome.do'; $post_fields['domain'] = 'renren.com'; //cookie文件存放在网站根目录的temp文件夹下 $cookie_file = tempnam('./temp','cookie'); $ch = curl_init($login_url); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_MAXREDIRS, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); curl_exec($ch); curl_close($ch); //带上cookie文件,访问人人网首页 $send_url='http://home.renren.com/Home.do'; $ch = curl_init($send_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); $contents = curl_exec($ch); curl_close($ch); //清理cookie文件 unlink($cookie_file); //输出人人网首页的内容 print_r($contents);
照片展示完整源码,开发vscode插件吗,ubuntu怎样关机,tomcat基线扫描,sqlite主键自增约束,jquery导航插件下载,电子商务网站前端框架,可以进行爬虫翻页的网站,php查看服务器,青山seo优化教程,php同学录网站源码,html5手机网页视频播放器代码,bootstrap登录界面模板lzw