The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 4 of 4

Thread: Client login - Please help!

  1. #1

    Client login - Please help!

    Hello!

    I'm wondering if anyone can suggest how to handle a basic client login. I'm doing graphic design for a client and I want them to be able to view the progress of the work I'm doing for them online by visiting my website. I want them to go to my website into a folder specifically for their business and then have to enter a password to be able to view the contents. I'm looking for a simple solution. Something like:

    1) First the client enters my website URL followed by the folder name of their business - whatever.com/client-1

    2) Window prompt pops up asking for username and password.

    3) Client enters in their specific username and password that I provide them with and it loads the "index of..." directory with a list of their files.

    I am fairly new to this, so any ideas how to do this would be extremely helpful!
    Thanks in advance!

    Nick.

  2. #2
    That's rather simple, though, when you have something basic there's usually an easy breach or you will nedd to black right clicks with a window pop-up and put the page in a frame, and load in the js So the source is relatively hidden. How secure would it need to be?

  3. #3
    Thanks for the response! If what you suggested adds more then just a little bit of work, then I don't want to bother with it right now because I don't really need high security yet. I just want something simple like I suggested doing because it's something temporary for people to see progress. Any other tips would be awesome, thanks!

  4. #4
    Sorry about the delay, forgot about this one

    I just whipped up this, a basic example of a login
    HTML Code:
    <html>
    <head>
    <script language="Javascript">
    var triesLeft = 3;
    function disAllowRightClick() {
       if (event.button==2) {
           alert('Did you know?:\nEvery time you right click a whale dies.');
       }
    }
    document.onmousedown=disAllowRightClick;
    
    function login() {
      var valid = true;
      popPassVal.innerHTML = "";
      popUserVal.innerHTML = "";
      popMessageVal.innerHTML = "";
      var user1 = 'memberhome.html';//Set up user's default log in homepage
      var user2 = 'memberhome.html';//Set up user's default log in homepage
      var user3 = 'memberhome.html';//Set up user's default log in homepage
      var user4 = 'memberhome.html';//Set up user's default log in homepage
      var user = document.log.user.value;
      var pass = document.log.pass.value;
    
      if (user == '' || user == undefined) {
        popUserVal.innerHTML = "<font color='#FF0000'>Please enter a username.</font>";
        valid = false;
      } 
      if (pass == '' || pass == undefined) {
        popPassVal.innerHTML = "<font color='#FF0000'>Please enter a password.</font>";
        valid = false;
      } 
    
      if (valid) {
    /*
    Sets up usernames and passwords
    Format is: user == "username" && pass == "users_password"
    */
        if (user == "user1" &&  pass == "pass1") {  
               window.location=user1;
        } else if (user == "user2" && pass == "pass2") { 
               window.location=user2;
        } else if (user == "user3" && pass == "pass3") { 
               window.location=user3;
        } else if (user == "user4" && pass == "pass4") { 
               window.location = user4;
        } else {//Not a user
               popMessageVal.innerHTML = "<font color='#FF0000'>Sorry,\n\n\"<b>"+user+"</b>\" is not a member!<br />"+triesLeft+" tries left.</font>";
               triesLeft == 0 ? window.location = "http://www.kirupa.com/forum" : triesLeft--;
        }
      }
    }
    </script>
    </head>
    
    <body>
    <form name="log">
    <font size="2" face="times">
    <div id="popMessageVal"><br /></div>
    <br />
    
    Username:
    <input type="text" name="user" size="10" />
    <div id="popUserVal"><br /></div>
    
    Password:
    <input type="password" name="pass" size="10" />
    <div id="popPassVal"><br /></div>
    
    <input name="Submit" type="button"  value="Log In" onClick="login()" size="10" />
    </font>
    </form>
    </body>
    </html>

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
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012