Hi there, I found the following login script at but I have another header problem...
I could use some help to fix this one, because I have no clue how to rearrange the script...
Here's the page that that is giving me headaches:
-----------------
<?
// filename --> login.include.php
/*
Enjoy and don't forget to credit ME!
*/
function checkCookie() {
global $prog, $xEasyAdmin;
global $HTTP_SERVER_VARS;
if ($xEasyAdmin == $prog[validate]) { // cookie is set!
return true;
}else{
return;
}
}
function makeCookie($days) {
global $prog, $xEasyAdmin;
setcookie("xEasyAdmin", $prog[validate], time() + (3600 * $days));
}
function removeCookie() {
global $prog, $xEasyAdmin;
setcookie("xEasyAdmin", "0", time() - 3600);
}
function showLoginDenied() {
// echo "Sorry your login was unsuccessfull please try again...<br>\r\n";";
// echo "<a href=\"login.php\">Login here</a>\r\n";
header("location: login.php"
;
}
function showLogin() {
global $prog;
echo "<h1>" . $prog[title] . "</h1>\r\n";
echo "<form action=\"$prog[program]\" method=\"post\"><table width=\"500\" bgcolor=\"#ccccff\">\r\n";
echo "<tr bgcolor=\"#ffffff\"><td>Username</td><td><input type=\"text\" size=\"25\" name=\"xAdminName\"></td></tr>\r\n";
echo "<tr bgcolor=\"#ffffff\"><td>Password</td><td><input type=\"password\" size=\"25\" name=\"xAdminPass\"></td></tr>\r\n";
echo "<tr bgcolor=\"#ffffff\"><td><input type=\"submit\" name=\"xAdminSubmit\" value=\"Submit\"></td></tr>\r\n";
echo "</table></form>\r\n";
}
function showLogout() {
global $prog;
echo "<h1>" . $prog[title] . "</h1>\r\n";
echo "<form action=\"$prog[program]\" method=\"post\"><table width=\"500\" bgcolor=\"#ccccff\">\r\n";
echo "<tr bgcolor=\"#ffffff\"><td><input type=\"submit\" name=\"xAdminSubmit\" value=\"Logout\"></td></tr>\r\n";
echo "</table></form>\r\n";
}
function checkLogin() {
global $prog, $xAdminName, $xAdminPass;
if ($prog[username] == $xAdminName && $prog[password] == $xAdminPass) {
return true; // login successfull
}
}
$prog[username] = "admin";
$prog[password] = "qwerty";
$prog[title] = "xEasyLogin v1.0 by ChandlerFOK";
$prog[validate] = "xEasyLoginCookie";
?>
---------------
The bold line is the line that's causing me trouble..
Anyone?
I could use some help to fix this one, because I have no clue how to rearrange the script...
Here's the page that that is giving me headaches:
-----------------
<?
// filename --> login.include.php
/*
Enjoy and don't forget to credit ME!
*/
function checkCookie() {
global $prog, $xEasyAdmin;
global $HTTP_SERVER_VARS;
if ($xEasyAdmin == $prog[validate]) { // cookie is set!
return true;
}else{
return;
}
}
function makeCookie($days) {
global $prog, $xEasyAdmin;
setcookie("xEasyAdmin", $prog[validate], time() + (3600 * $days));
}
function removeCookie() {
global $prog, $xEasyAdmin;
setcookie("xEasyAdmin", "0", time() - 3600);
}
function showLoginDenied() {
// echo "Sorry your login was unsuccessfull please try again...<br>\r\n";";
// echo "<a href=\"login.php\">Login here</a>\r\n";
header("location: login.php"
}
function showLogin() {
global $prog;
echo "<h1>" . $prog[title] . "</h1>\r\n";
echo "<form action=\"$prog[program]\" method=\"post\"><table width=\"500\" bgcolor=\"#ccccff\">\r\n";
echo "<tr bgcolor=\"#ffffff\"><td>Username</td><td><input type=\"text\" size=\"25\" name=\"xAdminName\"></td></tr>\r\n";
echo "<tr bgcolor=\"#ffffff\"><td>Password</td><td><input type=\"password\" size=\"25\" name=\"xAdminPass\"></td></tr>\r\n";
echo "<tr bgcolor=\"#ffffff\"><td><input type=\"submit\" name=\"xAdminSubmit\" value=\"Submit\"></td></tr>\r\n";
echo "</table></form>\r\n";
}
function showLogout() {
global $prog;
echo "<h1>" . $prog[title] . "</h1>\r\n";
echo "<form action=\"$prog[program]\" method=\"post\"><table width=\"500\" bgcolor=\"#ccccff\">\r\n";
echo "<tr bgcolor=\"#ffffff\"><td><input type=\"submit\" name=\"xAdminSubmit\" value=\"Logout\"></td></tr>\r\n";
echo "</table></form>\r\n";
}
function checkLogin() {
global $prog, $xAdminName, $xAdminPass;
if ($prog[username] == $xAdminName && $prog[password] == $xAdminPass) {
return true; // login successfull
}
}
$prog[username] = "admin";
$prog[password] = "qwerty";
$prog[title] = "xEasyLogin v1.0 by ChandlerFOK";
$prog[validate] = "xEasyLoginCookie";
?>
---------------
The bold line is the line that's causing me trouble..
Anyone?