can you please check my code and point out where i am going wrong with this code
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>Login</title>
<link rel="stylesheet" href="css/login.css" />
<script type="text/javascript">
function forgetMe() {
document.cookie = 'username = ; expires=Mon, 01 Jan 2000 00:00:00 GMT; path=/ ';
}
function logIn() {
if (document.getElementById('remember').checked = true) then {
var user = document.getElementById('user').value;
var date = new Date();
date.setTime(date.getTime()+15);
var expires = "; expires="+date.toGMTString();
document.cookie = Username+"="+user+expires+"; path=/";
}
}
function notice() {
ans = alert("This will save your username to this machine for 15 days. /nTo agree press ok or Cancel to stop this option");
if (ans = false) then {
document.getElementById('remember').checked = false;
}
}
</script>
</head>
<body onload="document.getElementById('user').focus()">
<div id="loginForm">
<h1 align="center">Log In</h1>
<form>
<div id="user">
<label for="user">Username</label><br />
<input name="user" type="text" id="user" value="<?php if(isset($_COOKIE['username'])){echo $_COOKIE['username'];} ?>" />
</div>
<div id="pass">
<label for="pass">Password</label><br />
<input name="pass" type="password" id="pass" maxlength="15" />
</div>
<br />
<input name="remember" type="checkbox" id="remember" onclick="notice()"/><label for="remember">Remember Me</label><br />
<a onclick="forgetMe()" id="forget">Forget me</a>
<br />
<br />
<input name="submit" id="submit" type="button" value="Log in" onclick="javascript: logIn()" />
</form>
</div>
</body>
</html>
according to google inspect element i have these errors:
Uncaught SyntaxError: Unexpected token { login.php:13
Uncaught ReferenceError: logIn is not defined login.php:47
thanks

New Topic/Question
Reply


MultiQuote



|