Forum Moderators: coopster
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?
Thanks!