Skip to content

Instantly share code, notes, and snippets.

@vanstee
Created July 25, 2011 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanstee/1103522 to your computer and use it in GitHub Desktop.
Save vanstee/1103522 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="./jquery/jquery.js"></script>
<script type="text/javascript">
function verifyLogin() {
$.post('./verify_login.php',
{username: $("#username").val(), password: $("#password").val() },
function(output) {
if (output == "") {
window.location="index.php";
}
alert(output);
});
}
</script>
<html>
<body>
<h1>Login</h1>
<form name="login" method="post">
<table align="center" cellpadding=5>
<tr>
<td>Username:</td>
<td><input type='text' id='username' value=''></td>
</tr>
<tr>
<td>Password:</td>
<td><input type='password' id='password' value=''></td>
</tr>
<tr align='center'>
<td colspan=2><input type="button" value="Log In" onclick="verifyLogin();">
<input type='reset' value='Clear'></td>
</tr>
</table>
</form>
<div id="errors" align='center'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment