note 62194 added to ref.curl

From: Date: Wed, 22 Feb 2006 06:40:01 +0000
Subject: note 62194 added to ref.curl
Groups: php.notes 
Request: Send a blank email to php-notes+get-104198@lists.php.net to get a copy of this message
I had the following experience when harvesting urls with a get variable from a page using cUrl. HTML pages will output ampersands as &amp when the page is read by the curl function. If you code a script to find all hyperlinks, it will use &amp instead of &, especially using a regular expression search. It is hard to detect because when you output the url to the browser it renders the html. To fix, add a line to replace the &amp with &. function processURL($url){ $url=str_replace('&','&',$url); $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $xml = curl_exec ($ch); curl_close ($ch); echo $xml; } } ---- Server IP: 64.71.164.2 Probable Submitter: 24.49.207.240 ---- Manual Page -- http://www.php.net/manual/en/ref.curl.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+62194 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62194&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+62194&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#104198) next »