Click to See Complete Forum and Search --> : Username/password Login


stephenjames716
07-22-2008, 11:42 AM
hello, I am looking to create a simple login page for a project I'm working on. basically I need to have a login/password prompt to be able to access a page with some forms people can download.

I am new to web design so any help would be appreciated.

thanks.

Mr. E. Cryptic
07-22-2008, 12:17 PM
1.Do you need something where people can sign up with their own un/pw, or do you just have 1 'master' username and password.

2. What kind of hosting set-up have you (eg: have you a control panel installed, what type is it, have you access to any scripting languages etc.)

depending on your needs, there's several different options. Also, (again depending on your needs), you might not be in the right sub-forum. Post more details about what you need, that's probably the best way to start.

stephenjames716
07-22-2008, 12:29 PM
thanks for your reply. basically what I will need to do is setup a page that will allow people to sign up for a username/password in order to login into a page that contains .pdf's related to the business for them to download.

I will be hosting the site with media temple.

thank you.

Mr. E. Cryptic
07-22-2008, 03:48 PM
In that case you'll need to look at a scripting language (like PHP) and a database (like MySQL).

First, check what scripting languages your host supports (sorry, not familiar with media temple). If it supports PHP and your package includes mysql DBs then I'd suggest this is the best way to go (just my opinion though, you'll get others).

If you do decide to go the PHP route, this (http://php.about.com/od/finishedphp1/ss/php_login_code_4.htm) might give you some guidance.

While the above link would probably get you up and running, I'd suggest that you spend some time learning at least the basic of your choosen scripting language before actually implimenting anything. it's always safer to know what you're doing. W3Schools (http://www.w3schools.com) is always a good place to get started with the basics.

wallacekp
07-22-2008, 06:13 PM
I have used this on a web site that I manage and it works very well.

http://www.mtopsoft.com/htmllock/

stephenjames716
07-24-2008, 09:50 AM
thanks for the replies. I would love to use something like htmllock, but am using a mac. does anyone know of any similar programs that I could use on a mac? thank you.

hitecbill
07-28-2008, 11:43 AM
what about secure passwords?

i have a u/n p/w thing for an admin page i wrote for content admin on a website and am concerned that i am sending plain text passwords.

the p/w is stored with SHA1, but i would like to encode it before sending..and then comparing.

should i use javascript for that?

cheers,
bill

Sakari
08-23-2008, 05:27 AM
Hi



Here's the script for the login form. I have the JavaScript in an external file.

HTML code (login.html):

<html>
<head>
<title>Please type your Username and Password... </title>
<script language="JavaScript" type="text/JavaScript" src="login.js"></script>
</head>
<body bgcolor="#eeeeee">
<form>
<br>
<center>
Username: <input type="text" name="username" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.background = '#ffffff';" onBlur="this.style.background = '#bfbfbf';">
<br>
Password: <input type="password" name="password" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.background = '#ffffff';" onBlur="this.style.background = '#bfbfbf';">
<br>
<input type="button" value="Login" onClick="Login(this.form);" style="background:#bfbfbf;color:#000000;border-color:#212121;" onMouseOver="this.style.color = '#404040';" onMouseOut="this.style.color = '#000000';" onFocusr="this.style.color = '#404040';" onBlur="this.style.color = '#000000';">
</center>
</form>
</body>
</html>

You can change the appearance.


External JavaScript code (login.js):

<!-- Begin

function Login(form) {
username = new Array("u1","u2","u3","u4","u5","u6","u7","u8","u9","u10");
password = new Array("p1","p2","p3","p4","p5","p6","p7","p8","p9","p10");
page = "secretpage" + ".html";
if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9]) {
self.location.href = page;
}
else {
alert("Either the username or password you entered is incorrect.\nPlease try again.");
form.username.focus();
}
return true;
}

// End -->

You can change the page = "secretpage" + ".html"; to whatever you want. The passwords are stored in arrays, I have just made the passwords u1, p1 for username1 and password1, but you can make them whatever you want.



thanks