homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Can I use file(http://url.com) despite http header 400?
AOL encquery decoding script no longer works because http 400 header

 1:26 am on Jul 4, 2008 (gmt 0)

I have been using this script to decode the AOL encquery parameter for some time:

if (stripos($url,"?encquery=") == TRUE) {
$pos = stripos($url,"?encquery=");
$query_url = substr($url,$pos+10);
$end_pos = stripos($query_url,"&");
if ($end_pos == null) {
$encoded_query = str_replace("+"," ",substr($query_url,0));
} else {
$encoded_query = str_replace("+"," ",substr($query_url,0,$end_pos));
$FU_AOL = implode( "", file( "http://search.aol.com/aol/search?encquery=$encoded_query" ));
preg_match( '/<title>[^>]*"([^"]+)"<\/title>/', $FU_AOL, $decoded_query );
$terms = $decoded_query[1];

This script was working fine up until about early May. The reason it stopped working is because the AOL url used in file() returns a http header 400. I did a random search on aol.com and checked the returned http header, and it returns 400 as well.

Is there anyway to get file() to work regardless of the returned header? Do I have any other options to load the AOL result page's source code into an array or variable?




 4:25 am on Jul 4, 2008 (gmt 0)

other options:

[php.net...] and

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved