RE: [PHP] Changing User Agent for fopen

From: Date: Thu, 04 Dec 2003 15:52:11 +0000
Subject: RE: [PHP] Changing User Agent for fopen
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171843@lists.php.net to get a copy of this message
You might want to look at curl as an alternative -- it gives you a lot more flexibility than fopen. -- jon ------------------- jon roig web developer email: jon@trafficdesigns.com phone: 888.230.7557 -----Original Message----- From: Gohaku [mailto:gohaku@earthlink.net] Sent: Thursday, December 04, 2003 8:36 AM To: php-general@lists.php.net Subject: [PHP] Changing User Agent for fopen Hi everybody, There are some pages I would like to extract links from but I can't access the page using the following: ini_set('php.user_agent', 'Mozilla/5.0'); $url = "http://www.google.com/search?q=php"; $fp = fopen($url,"r"); $buffer = fread($fp,1000000); echo $buffer; Also, what is the best number to use when allocating Buffer space for a URL? Is 1000000 too much? Thanks. -Gohaku -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.544 / Virus Database: 338 - Release Date: 11/25/2003

« previous php.general (#171843) next »