That is basically the same thing except they are storing the Unique id in a file, which is usually referred to as a "flat database".
Also there system doesn't have the unique url expire. The problem with this is the user will be able to reuse the url at any time so they could save it in their favorites or type in part of the url and the browser will suggest the rest.
You should note that the article was produced in 2003 and much of the PHP will be out of date. And I personally think it maybe over complicated.
Maybe you could try using a session. It is possible to store session data across pages fairly easily.
So you generate the unqiue id and then store it in a session.
PHP Code:
<?php
session_start(); // this must be the very first line of code on all pages no exceptions
$alphanum = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$uniqueid = '';
for ($i = 0; $i < 8; $i++) {
$uniqueid .= $alphanum[(rand() % strlen($alphanum))];
}
$_SESSION['uniqueid'] = $uniqueid;
$_SESSION['time'] = time() + 21600; //21600 adds 6 hours to the the current time
?>
<html>
<!-- your html here -->
<a href="http://www.yoursite.com/nextpage.php?id=<?php echo $uniqueid ; ?>"><img scr="yourbanner.jpg /></a>
</html>
Then on the page they are going to check the $_SESSION data against the url
PHP Code:
<?php
session_start(); // this must be the very first line of code on all pages no exceptions
if (($_SESSION['uniqueid'] != $_GET['id']) || ($_SESSION['time'] <= time())) {
header('Location: $_SERVER['HTTP_REFERER']') // this line must be before any text or html is generated
}
else {
?>
<html>
<!-- Your HTML Here -->
</html>
<?php
}
?>