Location: PHPKode > scripts > robots.wizard(tm) > robots-wizardtm/header.php
<?php
/* robots.wizard header.php copyright 2006 Betsy A. Gamrat all rights reserved 

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Contact Information: Betsy A. Gamrat hide@address.com

*/
/*
This is the authentication check for robots.wizard.  It is included by index.php
to limit access to robots.wizard.
*/
session_cache_expire(15);
session_start();
include "auth.php";

if (isset($_SESSION['sha1_auth_code']))
{
	if ($_SESSION['sha1_auth_code']!==sha1($auth_code))
		enter_auth_code("Invalid or expired authorization code");
}
else
{
	if (isset($_POST['auth_code']))
	{
		if ($_POST['auth_code']===$auth_code)
			$_SESSION['sha1_auth_code']=sha1($auth_code);
		else
			enter_auth_code("Invalid authorization code");
	}
	else
	{
		if ($_SERVER['QUERY_STRING']==="logout")
			enter_auth_code("Session ended, re-enter authorization code");
		else
			enter_auth_code("Please enter authorization code");
	}
}

function enter_auth_code($prompt)
{
echo <<< AUTH
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META NAME="COPYRIGHT" CONTENT="&copy; 2006 Betsy A. Gamrat All Rights Reserved" />
<title>Authentication</title>
<link type="text/css" rel="stylesheet" href="stylesheets/index.css" />
</head>
<body>
<div class="banner">
<h1>robots.wizard<sup style="font-weight:normal;font-size:.7em">TM</sup></h1>
</div>
<p>
The authentication code is used to protect the site from unauthorized directory access.  
You must enter the valid authentication code to use robots.wizard<sup style="font-size:.7em">TM</sup>.  
For full protection, use the "Exit" button to clear the session data, and allow the browser to close.  
Sessions expire after 15 minutes of inactivity.
</p>
<form action="index.php" method="post" name="auth">
$prompt: <input type="password" maxlength="30" name="auth_code" value="authcode" />
</form>
<p>
The initial authentication code is delivered in the purchase email.  You may change it 
as described in the documentation.
</p>
<script language="javascript" type="text/javascript">
function cookie_check()
{
        var ret_val=true;
        if (!navigator.cookieEnabled)
        {
                ret_val=false;
                alert('Cookies are disabled.  This site uses a cookie on your computer to better protect your session id.  Please enable cookies.');  }
        else
                document.forms['auth'].submit();
        return ret_val;

}
</script>
</body>
<hr />
<A HREF="http://www.hotscripts.com?RID=N459643"><IMG SRC="http://images.hotscripts.com/static/2.gif" border="0"></A>
<!------ Start of HTML Code ------->
<table width="250" border="1" cellpadding="4"
cellspacing="0" bordercolor="#840300" bgcolor="#D70500"><form
action="http://www.hotscripts.com/rate/56557.html" method="POST">
<tr>
<td>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><strong><font color="#FFFFFF">If you like our
script, please rate it!</font></strong>
<input type="hidden" name="external" value="1"></td>
</tr>
<tr>
<td><select name="rate" size="1">
<option value="5" selected>Excellent!</option>
<option value="4">Very Good</option>
<option value="3">Good</option>

<option value="2">Fair</option>
<option value="1">Poor</option>
</select>
<input name="submit" type="submit" value="Cast My Vote!"> </td>

</tr>
</table></td>
</tr></form>
</table>
<!------ End of HTML Code ------->
</html>
AUTH;
exit();
}
?>
Return current item: robots.wizard(tm)