SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2012
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question how to code a button (login) to verify username + password and redirect it to an url

    hello,

    I have placed two textboxes on my html webpage - (1) username and (2) password textbox together with a (3) Login button.

    on this site, I will provide users with a unique username and password prior to their login. Hence, I need to:

    (a) verify that the name and password is correct otherwise, alert users to correct it or contact the admin
    (b) if the username and password was correct - redirect users to a URL page on my website e.g page2

    could you please advise me how i can code this in javascript?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by faez View Post
    could you please advise me how i can code this in javascript?
    This cannot be done effectively in JavaScript without working in with server-side code that handles the database and verification side of things.

    The way to use JavaScript for such a task as this, is to first create a solution that doesn't use JavaScript, and to then use JavaScript on the top of the base solution to improve the user experience.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •