For each PHP file you wish to search the contents of, you could read the file into a string using file_get_contents()
http://php.net/manual/en/function.file-get-contents.php
What format do you have the day of the week in? Is it a timestamp? Take a look at http://uk.php.net/manual/en/function.date.php, which should help you out.
SS
Sorry, I meant in reference to the earlier posts that are talking about deciding to do a redirect half way through a script after other output has been made.
SS
For completness, can I just add that http_redirect() is part of the PECL extension to PHP so might not be installed, and as far as I am aware, it would behave the same way as header("Location:..")...
Yes, they should be the same. It is either your script is in the wrong location or the value in open_basedir arent set up for you correctly. Most certainly it is something that your server host could...
$sqltotaluniqueweek = "select distinct ip from stats where received > date_sub(currentdate(), INTERVAL 7 DAY);";
give that a bash. Please note I havent tested this, so no promises.