SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Word Launcher Login Page

    Hiya Folks,

    Is there anyway of create a login page that only requires the user to enter their username.

    Instead of having a text box in this case, to allow the user to enter their username, is it possible the user can just enter their username directly on the page, using the same principles as the page found at the following URL:

    The JavaScript Source: Navigation: Word Launcher - Type the word "javascript" directly onto the page.

    And if the username is in the database, the user gets logged in.

    Many Thanks, much Appreciated!

  2. #2
    SitePoint Addict betrollwin.com's Avatar
    Join Date
    Nov 2005
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i know how to do it in the url and through a text box but i dont you can just type anywhere on the screen and it will login (you can type into a textbox and when a username is recognized itll autologin). and the link above, when i type javascript, nothing happens (im using firefox).

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2007
    Location
    New London, CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you try to even type when you are on that page you get an error with every key stroke.

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    There are a couple of reasons why this isn't a good idea....
    1/ It doesnt work in all browsers (even though it says it does!)
    2/ Accessibility
    3/ If Javascript is turned off for whatever reason, the users cant login

    It's an interesting gimick but thats all it is. The convention is to have a login box and that is what users would expect to look for, going against convention would confuse alot of people.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Word Launcher Login Page

    1) Try the following script. (Fixed)
    2) The username will be entered using a barcode reader, therefore a conventional login box is not need. A login box option will be provided, incase Barcode Scanner is not obtainable. Thats fine it's designed to be like that for a personal PHP
    application.
    3) How do I warn people if JavaScript is disabled?

    Thats fine it's designed to be like that for a personal PHP application.

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    var SpecialWord = "search",
        SpecialUrl = "http://google.co.uk",
        SpecialLetter = 0;
    
    function getKey(e) {
    var eventChooser = (e) ? e.which : event.keyCode;
    
    var which = String.fromCharCode(eventChooser).toLowerCase();
    if (which == SpecialWord.charAt(SpecialLetter)) {
    SpecialLetter++;
    if (SpecialLetter == SpecialWord.length) window.location = SpecialUrl;
    }
    else SpecialLetter = 0;
    }
    document.onkeypress = getKey;
    //  End -->
    </script>

  6. #6
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    F10 the majority of bar code scanners dump thier output into the keyboard buffer. So if you have a standard login box as per the previous post suggestions the output of the barcode scanner will dump into the same text box that the user could / would type into if he / she did not have a scanner. One last caveat you will need a little javascript to set the focus to your user name text box on page load.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  7. #7
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Word Launcher Login Page

    it appears to work, if I use the Word Launcher Script (Post Previously), and scan barcode, and log the output codes as the (Special Word) in the script, the page is re-directed to "google.co.uk"

    How do I adapt the script and include PHP code, so that the script check the username against the usernames in the database, and if the username is present, it logs that user onto the system?

    Many Thanks, much appreciated!


Bookmarks

Posting Permissions

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