Forum Moderators: coopster
Of course, there's lots of things people can do that will change their page content without the main content of the page changing (think "quote of the day" or navigation changes). So, a really robust page update checker can't just rely on simply comparing the strings, but it may work for your purposes.
So, very roughly, your script might look something like:
$cache_path = '/path/to/some/directory/php/can/write/to/';
$url_to_check = 'http://www.example.com/page1.html';
if(file_exists($cache_path.md5($url_to_check))){
$last_content = file_get_contents($cache_path.md5($url_to_check));
$current_content = file_get_contents($url_to_check);
if($last_content != $current_content){
// perform a mysql query
}
}
file_put_contents($current_content, $cache_path.md5($url_to_check));