<?php
$ip=$_SERVER['REMOTE_ADDR'];
require_once "class.test.php";
$kg = new test2();
$keepgoing = $kg->keepGoing();
if ($ip==99.99.99.99)
{
while ($keepgoing)
{
$fh = fopen($myfile, 'a') or die("Cannot open file");
$stringtowrite="this is a test\n";
fwrite($fh, $stringtowrite);
fclose($fh);
sleep(60);
}
}
else
{
echo "You do not have access to this script."
}
?>
and here's a portion of class.test.php:
<?php
class test2
{
public $keepgoing=true;
function keepGoing() { return $this->keepgoing; }
}
?>
So right now the script will only run a.) when the person's IP address is 99.99.99.99 and b.) when the $keepgoing variable in class.test.php is true. But my problem is preventing that person from opening this script multiple times in their browser. I want to make it so that they can only open it once. So if the script is already open and running from their IP address, it will tell them that they cannot open more than one instance of the script from their IP address. Is this possible? If so, could someone please tell me how I could accomplish this? I greatly appreciate it. Thank you very much.

New Topic/Question
Reply




MultiQuote







|