note 91510 added to function.curl-setopt

From: Date: Sun, 14 Jun 2009 11:56:26 +0000
Subject: note 91510 added to function.curl-setopt
Groups: php.notes 
Request: Send a blank email to php-notes+get-156847@lists.php.net to get a copy of this message
I noticed that if you want to get current cookie file after curl_exec() - you need to close current curl handle (like it said in manual), but if you want cookies to be dumped to file after any curl_exec (without curl_close) you can: #call it normally $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIEFILE, "cookiefile"); curl_setopt($ch, CURLOPT_COOKIEJAR, "cookiefile"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_URL, 'http://avtoproblemi.ru'); $result1 = curl_exec($ch); #and then make a temp copy $ch_temp=curl_copy_handle(ch); curl_close($ch); $ch=$ch_temp; Only this way, if you close $ch_temp - cookies wont be dumped. ---- Server IP: 91.199.167.18 Probable Submitter: 82.192.88.45 ---- Manual Page -- http://www.php.net/manual/en/function.curl-setopt.php Edit -- https://master.php.net/note/edit/91510 Del: integrated -- https://master.php.net/note/delete/91510/integrated Del: useless -- https://master.php.net/note/delete/91510/useless Del: bad code -- https://master.php.net/note/delete/91510/bad+code Del: spam -- https://master.php.net/note/delete/91510/spam Del: non-english -- https://master.php.net/note/delete/91510/non-english Del: in docs -- https://master.php.net/note/delete/91510/in+docs Del: other reasons-- https://master.php.net/note/delete/91510 Reject -- https://master.php.net/note/reject/91510 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156847) next »