I need help in searching for a string.
I have a database filled with banners.
I need to check to see if those banners expired (see if those links are still activite or not).
I need to search for a particular string (
This merchant is no longer participating
error_click_logo.gif
)
Everytime i do this, it takes for ever and I GET PERMISSION DENIED errors. Please advise.
can you please help in making this a faster process . Help in changing the function? I have about 1100 banners total.
Thanks.
$banner_query = db_query("Select banners_id, banners_url from banners");
$num_rows = db_num_rows($banner_query);
$banners=db_fetch_array($banner_query);
for ($i=0; $i<($num_rows); $i++){
$file = file_get_contents($banners['banners_url']);
$invalid_error = test_for_error_page($file);
..........
$banners=db_fetch_array($banner_query);
}
function test_for_error_page($html){
$error=false;
if ( (strstr($file,"error_click_logo.gif") != false) || (strstr($file,"This merchant is no longer participating") != false)){ // found the error page
$error=true;
}
return $error;
}
Warning: file_get_contents(): HTTP request failed! in /home/mysite/public_html/admin/check_links.php on line 13
Warning: file_get_contents(http://www.qksrv.net/click-1171617-10285911): failed to open stream: Permission denied in /home/mysite/public_html/admin/check_links.php on line 13
Warning: file_get_contents(): SSL: fatal protocol error in /home/mysite/public_html/admin/check_links.php on line 13
Warning: file_get_contents(): HTTP request failed! HTTP/1.1 500 Internal Server Error in /home/mysite/public_html/admin/check_links.php on line 13