I wrote the script below to get an login working. Sometimes it just works, but most of the time it says: “top.nav.location” is empty or not an object.
I don’t understand what’s going wrong, because there’s a frame called “nav”. (the function is called from that frame!)
Anyone can help me out?
(Maybe better question: is there a way to do what I do now using PHP and not JavaScript?
[code]
<?
$username = $_POST[“ussr”];
$password = $_POST[“psswrd”];
if ($username == “administrator”){
if ($password == “testje”) {
echo (“<script language=”Javascript”>top.nav.location.href=”../html_bestanden/vrijwilligers/vrijwilnav.htm”;
top.main.location.href=”../html_bestanden/vrijwilligers/vrijwilmain.htm”;</script>”);
}
Else {
echo (“<script language=”Javascript”>alert(“Gebruikersnaam en/of wachtwoord onjuist.”);</script>”);
}
}
?>
Additional question: All users who will login need their own username.
Is it easier to use a MySQL database, or just say
[code]
if ($username=”user1″ || $username=”user2″
Regards,
René