curl获取cookies和session登录站点的内部内容
- <form action="curl.php" method="post">
- Address:<input type="text" name="url" />
- COOKIE和SESSION值:<input type="text" name="config" />
- <input type="submit" value="submit" />
- </form>
- <?php
- error_reporting(7);
- if($_POST['url']=="" OR $_POST['config']==""){
- echo "请在上面输入相关设置!";
- exit;
- }
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "".$_POST['url']."");
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($ch,CURLOPT_COOKIE, "".$_POST['config']."");
- $re = curl_exec($ch);
- curl_close($ch);
- echo $re;
- ?>
复制代码
看了"太阳雨"的curl文章,写了一个小东西.呵呵. 上面的代码保存为curl.php然后输入要进入的网址和用Wsockexpert获取的COOKIES值然后就可以不用通过登录进入你想进入的页面了. 这样就可以采集相关信息了 |
此文章由 http://www.ositren.com 收集整理 ,地址为:
http://www.ositren.com/htmls/29844.html