Location: PHPKode > projects > GBook > login.php
<?
// GBook made by Racin Nygaard. If you have any questions please ask them on irc (darkking @ Efnet)
// Or email me at: hide@address.com :)

// Don't remove this include!
include("config.php");

global $adminpassword, $adminusername;
if (isset($_COOKIE["checklogin"]) && $_COOKIE["checklogin"] == $adminpassword) 
{
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=admin.php\">";
}
elseif (!isset($_GET["login"]))
{
    
$query = "select * from $designtable";
$result = mysql_db_query($database, $query, $link) or die(mysql_error());
$design = mysql_fetch_row($result);

$title = $design[1];
$background = $design[2];
$picture = $design[3];
$tablebg = $design[4];
$txtcolor = $design[5];
$logopoint = $design[6];
$aover = $design[7];
$alink = $design[8];
$active = $design[9];
$avis = $design[10];

echo "
<html><head><title>Login to ".$title."</title>
<style type=\"text/css\">
BODY {
        SCROLLBAR-FACE-COLOR: #B0B0B0; SCROLLBAR-HIGHLIGHT-COLOR: #000000;
        SCROLLBAR-SHADOW-COLOR: #333333; SCROLLBAR-3DLIGHT-COLOR: #2e425a;
        SCROLLBAR-ARROW-COLOR: #3300FF; SCROLLBAR-TRACK-COLOR: #000000;
        SCROLLBAR-DARKSHADOW-COLOR: #000000; BACKGROUND-COLOR: $background;
}
A:link {
        COLOR: $alink; TEXT-DECORATION: none
}
A:active {
        COLOR: $active; TEXT-DECORATION: none
}
A:visited {
        COLOR: $avis; TEXT-DECORATION: none
}
A:hover {
        COLOR: $aover;
}

</style><font face=\"Verdana,Geneva,Arial,Helvetica,sans-serif\" color='$txtcolor' size=\"2\"></head>
<center><div align=\"center\"> Hello, you now need to enter username and password to access the admin section. 
<br><br>
<form method=\"POST\" action=\"login.php?login\">
Username:<input type=\"text\" name=\"username\">
Password:<input type=\"password\" name=\"password\">
<input type=\"submit\" value=\"GO!\">
</div></html>";
}
elseif (isset($_GET["login"]) && $_POST["username"] == $adminusername && md5($_POST["password"]) == $adminpassword )
{
setcookie('checklogin', $adminpassword);
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=admin.php\">";
}
else 
{ echo "You entered wrong username/password"; }

?>
Return current item: GBook