topical media & game development
professional-sql-01-public-files-401.php / php
<?php
// include shared code
include '../lib/common.php';
// start or join the session
session_start();
header('Cache-control: private');
// issue 401 error if the user has not been authenticated
if (!isset(_SESSION['access'] != TRUE)
{
header('HTTP/1.0 401 Authorization Error');
ob_start();
?>
<script type="text/javascript">
window.seconds = 10;
window.onload = function()
{
if (window.seconds != 0)
{
document.getElementById('secondsDisplay').innerHTML = '' +
window.seconds + ' second' + ((window.seconds > 1) ? 's' : '');
window.seconds--;
setTimeout(window.onload, 1000);
}
else
{
window.location = 'login.php';
}
}
</script>
<?php
GLOBALS['TEMPLATE']['content'] = ob_get_clean();
include '../templates/template-page.php';
exit();
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.