PHP头条
热点:

php使用curl存储cookie的示例


 这篇文章主要介绍了php使用curl存储cookie的示例,需要的朋友可以参考下

代码如下: <?php $curl = curl_init(); $url = 'http://www.jb51.net/admin/gateway/login'; $data = array(  'username'=>'admin',  'password'=>'123' ); $cookie = tempnam('./temp','cookie'); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_POST,count($data)); curl_setopt($curl,CURLOPT_POSTFIELDS,$data); curl_setopt($curl,CURLOPT_COOKIEJAR,$cookie); ob_start(); curl_exec($curl); $result = ob_get_contents(); ob_end_clean(); curl_close($curl);  

www.phpzy.comtrue/php/13664.htmlTechArticlephp使用curl存储cookie的示例 这篇文章主要介绍了php使用curl存储cookie的示例,需要的朋友可以参考下 代码如下:?php$curl = curl_init();$url = 'http://www.jb51.net/admin/gateway/login';$data = array('username'='...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐