Help using Ajax to log in to wiki
Earlier I received a lot of help guiding me to fake a background so I could fade it in. Thanks so much. I'm still working on the same site when I find the time, and I wanted people to be able to log into the wiki from the homepage using ajax so the page wouldn't refresh. My problem is that the page still refreshes, even with a return false in the code. Additionally, I would like to add a success / failure message upon login. The wiki that I am trying to log in to uses a .php to accept logins. The reason I wanted an ajax function was so that the .php wouldn't redirect me to the homepage, since the login .php always returns you to the previous page unless you don't have a http referrer listed.
I would just change the .php file, but I don't know php.
Additionally, trying to login the first time gives me a cookie error, but the second time the login is successful, but reloads the page.
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="jquery.form.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
$("#body").hide();
$("#hid").hide();
$("#body").addClass("body");
$("#body").fadeIn(10000);
$("#button").click(function() {
$("#login").ajaxform(options);
$("#login").submit(function() {
$(this).ajaxsubmit();
return false;
});
return false;
});
$("#a").click(function() {
$("#a").fadeOut("slow", function() {
$("#hid").fadeIn("slow");
});
});
$("#close").click(function() {
$("#hid").fadeOut("slow", function() {
$("#a").fadeIn("slow");
});
});
$("#leave").click(function() {
$(".div").fadeOut("slow", function() {
window.location = "blank.html";
});
});
});
//-->
</script>
<title>Future Home of Band Wars!</title>
<style>
body{
overflow: hidden;
}
.body{
width: 100%
height: 100%
z-index: -1;
}
.div{
z-index: 1;
position: absolute;
top: 0px;
text-align:center;
width:768px;
left:50%;
margin-left: -384px;
}
.nolink{
text-decoration: underline;
cursor: pointer;
}
table{
text-align:center;
}
</style>
<meta name="generator" content="screem 0.16.1">
<meta name="author" content="Mr.J">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta content="78sUPeRVZSrMOXVHhR9K0CBPVKlRJhiJI2a2kHdPitc=" name="verify-v1">
</head>
<body class="body" link="#f9c805" vlink="red" text="#f9c805" bgcolor="black">
<img alt="" src="http://i490.photobucket.com/albums/rr263/leegeeks/starfieldsmall.png" id="body">
<div class="div">
<h3>This is the Future home of Band Wars!<br>
This site is currently under construction. Check back soon!</h3><br>
<img alt="" src="http://i490.photobucket.com/albums/rr263/leegeeks/bw1.png" id="img"><br>
<br><br>
<a class="nolink" id="leave">Band Wars Episode I: Attack of the Trombones</a><br><br>
<a id="a" class="nolink">Project Members - Click to go to the development Wiki.</a>
<div id="hid">
This area is for developers only.<br>
Please enter your username and password.<br>
<form method="post" id="login" action="http://bandwars.x10hosting.com/wiki/tiki-login.php">
<table align="center" cellspacing="10">
<tbody>
<tr>
<td><label for="user">User:</label><input name="user" id="user" type="text"></td>
<td><label for="pass">Password:</label><input name="pass" id="pass" type="password"></td>
<td><input id = "button" value="Login" type="submit"></td></tr></tbody></table></form><a id="close" class="nolink">Close this Dialogue</a></div></div>
</body>
</html>
Thanks in advance for any help.