www.webdeveloper.com
Results 1 to 9 of 9

Thread: Username/password Login

  1. #1
    Join Date
    Jul 2008
    Posts
    8

    Username/password Login

    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.

  2. #2
    Join Date
    Jun 2008
    Posts
    277
    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.
    You can't have manslaughter without laughter!

  3. #3
    Join Date
    Jul 2008
    Posts
    8
    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.

  4. #4
    Join Date
    Jun 2008
    Posts
    277
    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 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 is always a good place to get started with the basics.
    You can't have manslaughter without laughter!

  5. #5
    Join Date
    Jan 2006
    Location
    Surrey, UK
    Posts
    64
    I have used this on a web site that I manage and it works very well.

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

  6. #6
    Join Date
    Jul 2008
    Posts
    8
    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.

  7. #7
    Join Date
    Mar 2005
    Location
    planet earth
    Posts
    121
    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
    captain, i've spotted an M-class planet!

    http://eupeople.net/forum

  8. #8
    Join Date
    Jul 2008
    Posts
    13
    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

  9. #9
    Join Date
    Jun 2013
    Posts
    2
    hi very nice is also possible to different tragare( URL) if yes please write me back How ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles