<?
session_start();
header("Cache-control: private"); // IE 6 Fix.
include "config.php";
?>
<HTML>
<HEAD>
<link rel="stylesheet" href="css.css" type="text/css">
<title>CJ Website Search Control Panel</title>
</HEAD>
<body topmargin="50" leftmargin="50">
<IMG SRC="top.gif" WIDTH="300" HEIGHT="81" BORDER="0" ALT="CJ Website Search"><p>
<?
if($_GET['action'] == "submit"){
if(!isset($_POST['username']) || !isset($_POST['password'])){
print "<font color=maroon><b>No Username or Password</b></font><p><p>";
login();
footer();
exit;
}
else if($_POST['username'] == $user && $_POST['password'] == $pass){
$username = $_POST['username'];
$_SESSION['username'] = $username;
$password = $_POST['password'];
$_SESSION['password'] = $password;
print "<font color=darkblue>Successfully logged in!</font><p>";
echo "Click <A HREF=\"admin.php?";
echo session_name();
echo "=";
echo session_id();
echo "\">Here</a> to Continue...";
footer();
exit;
}
else{
print "<font color=maroon><b>Incorrect Username or Password</b></font><p><p>";
login();
footer();
exit;
}
}
else{
print "<font color=maroon>You must be logged in to view the Admin Control Panel</font><p><p>";
login();
footer();
exit;
}
function login(){
?>
<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tr>
<td width="1%"><img border="0" src="gfx/login.jpg" width="50" height="50"></td>
<td width="99%"><font size="3">Admin Login</font></td>
</tr>
</table>
<br><form method="post" action="login.php?action=submit">
<table border="0" cellpadding="5" cellspacing="0" width="100">
<tr>
<td><b>Username</b></td>
<td> <input type=text name=username size="20"></td>
</tr>
<tr>
<td><b>Password</b></td>
<td> <input type=password name=password size="20"></td>
</tr>
<tr>
<td colspan="2">
<center><input type=submit value='Enter Admin Area'></center>
</td>
</tr>
</table>
</form>
<?
}
// If you like this script then vote for it at Hotscripts or PHPResource or wherever you got it from!
// I would appreciate it if all copyright could remain to abide with the Data Protection act.
// If you would however like to remove it then a kind donation should be sent via paypal to hide@address.com
// Please do not manipulate this code to pass it off as your own
function footer(){
?>
<p><p>
<hr>
CJ Website Search © 2003 <a href="http://www.cj-design.com">CJ Website
Design</a> | <A HREF="http://www.cj-design.com/?id=forum">Script Support</A> | <A HREF="http://www.cj-design.com/?id=donate">Donate</A>
</BODY>
</HTML>
<?
}
?>