Like this
all code this time
if (!$QUERY_STRING) {
if (!file_exists("urls")) {
echo "RandomURL error! The file \"urls\" could not be found.";
exit;
}
if (filesize("urls") < 1) {
echo "RandomURL error! The file \"urls\" is empty. You should insert at least two URLs into it.";
exit;
}
if (!is_readable("urls") || !is_writeable("urls")) {
echo "RandomURL error! The file permissions for the file \"urls\" has not been set correctly.";
exit;
}
$date = date ("H");
if ($date == 24) {
$urls = file("urls");
srand((double)microtime()*1000000);
$urlnumber = rand(0, sizeof($urls) - 1);
header("Location: $urls[$urlnumber]");
exit;
}
lilRachie
😃