PDA

View Full Version : Want to add features to this script


tiredofcoding
11-26-2009, 06:30 PM
Hi guys,
name says it all! lol.

Ok Here are the scripts I have implemented into my site. I can upload these into my server but I CANNOT insert php files or apache anything. I want to use these codes but I want to implement some features.

Feature Requests

Protect certain pages if not logged in
Show logged in name and include a logout button.
also have a remember me check box to remember logged in user on computer
change the design of the login box(its to plain)
possible integrate a payment feature???who knows. this ones a long shot
put a small "sign up" word within login box along with forgot password into login box.


Thanks for your help in this.
I can upload .js and .htm files into server. I can place any type of coding within pages to coincide with files on server.
auth.htm


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Authorization in progress...</title>
<script type="text/javascript">
<!--
/*
Javascript Secure Login

*/
var authstring = "<script type=\"text/javascript\" src=\"" + location.search.substring(1) + ".js\"><\/script>";
if (location.search) document.write(authstring);
// -->
</script>
</head>
<body>
<script type="text/javascript">
<!--
window.auth ? location.replace(redirect) : location.replace("login.htm?auth=failed");
// -->
</script>
</body>
</html>

Login.htm
]<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Login</title>
<script type="text/javascript">
<!--
function authPass(u,p) {
if (u && p) self.location = "http://www.mywebsites/login/auth.htm?" + u + p;
return false;
}
// -->
</script>
</head>
<body>
<div>
<script type="text/javascript">
<!--
if (location.search.indexOf("auth=failed") != -1) {
document.write("<span style=\"color:#ff0000\">Username/Password Incorrect! </span>");
}
// -->
</script>
<form id="form1" action="javascript://" onsubmit="return authPass(this.user.value,this.pass.value)">
<table>
<tr>
<td>Username: </td><td><input type="text" name="user" /></td>
</tr>
<tr>
<td>Password: </td><td><input type="password" name="pass" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Login" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>]
Page.htm
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Login</title>
</head>
<body>
Correct password (destination page goes here, instead of this one)
</body>
</html>

I have a user database file that I make for every user and name it the username password.js

Ex.
username: nick
pass:nick12
file name uploaded to same folder as login.htm
"nicknick12.js"
then within the file I say auth true and redirect to page I want them to go to.
Within this file I would like to have an auth false but not go to the default login.htm "password incorrect" page. Its white and bland. I want it to match my sites layout.

Any help would be thnkful. I am willing to buy beer for you too:thumbsup: