note 64447 added to function.curl-setopt

From: Date: Fri, 14 Apr 2006 14:22:19 +0000
Subject: note 64447 added to function.curl-setopt
Groups: php.notes 
Request: Send a blank email to php-notes+get-108075@lists.php.net to get a copy of this message
Sometimes you can't use CURLOPT_COOKIEJAR and CURLOPT_COOKIEFILE becoz of the server php-settings(They say u may grab any files from server using these options). Here is the solution 1)Don't use CURLOPT_FOLLOWLOCATION 2)Use curl_setopt($ch, CURLOPT_HEADER, 1) 3)Grab from the header cookies like this: preg_match_all('|Set-Cookie: (.*);|U', $content, $results); $cookies = implode(';', $results[1]); 4)Set them using curl_setopt($ch, CURLOPT_COOKIE, $cookies); Good Luck, Yevgen ---- Server IP: 216.194.113.175 Probable Submitter: 207.210.80.172 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php Edit -- http://master.php.net/note/edit/64447 Del: integrated -- http://master.php.net/note/delete/64447/integrated Del: useless -- http://master.php.net/note/delete/64447/useless Del: bad code -- http://master.php.net/note/delete/64447/bad+code Del: spam -- http://master.php.net/note/delete/64447/spam Del: non-english -- http://master.php.net/note/delete/64447/non-english Del: in docs -- http://master.php.net/note/delete/64447/in+docs Del: other reasons-- http://master.php.net/note/delete/64447 Reject -- http://master.php.net/note/reject/64447 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#108075) next »