The current login script is as below (I got these from others):
BTW, is it safe to read the login information from the config file? Or what's the safe way to store and read the login information?
include "config.php";
//Login
session_start();
$admuserS = $SESSION[user];
$admuserC = $COOKIE[user];
$admuser = $admuserc? $admuserS : ($admuserC? $admuserC : false);
$loggedin = 0;
$msg = "";
if(!$admuser AND $POST){
if($POST[user]==$admin_username && $POST[pass]==$admin_password){
$SESSION[user] = $POST[user];
setcookie("user", $POST[user], time()+7200, "/", str_replace(".", "", $_SERVER[HTTP_SERVER_NAME]));
$loggedin = 1;
}else{
$msg = "Wrong username or password<hr>";
}
}