欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

PHP CURL 伪造HTTP_REFERER

PHP CURL 伪造HTTP_REFERER

 (2011-07-05 14:06:43)
标签: 

杂谈

分类: php
首先确定php.ini
extension=php_curl.dll 这个扩展是开启的
1.PHP

        $post_data = array (
           "nameuser" => "syxrrrr",
            "pw" => "123456"
        );
        $ch = curl_init();
       
       curl_setopt ($ch, CURLOPT_URL, 'http://localhost/2.PHP');
       curl_setopt ($ch, CURLOPT_HEADER, 0);
       curl_setopt ($ch,CURLOPT_REFERER,'HTTP://www.baidu.com');
       curl_setopt ($ch, CURLOPT_POST, 0);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
       curl_exec ($ch);
       curl_close ($ch);
2.PHP
       $a=getenv('HTTP_REFERER');
       echo 'HTTP_REFERER=>'.$a;

来自 http://blog.sina.com.cn/s/blog_6d425e1a0100vrc6.html
普通分类: