html – Javascript Login Page

html – Javascript Login Page

First I cant answer this without stating that Philip, George, Sarah or Michael wont thank you for making their passwords visible in this way:

var pwArray = [Password1, Password2, Password3, Password4];

As others have said: If you were to code a page like this there is no point in using passwords as they would be visible to all users of the page.
However given the method you have used so far, you could do the following

var pwLocation = [location1, location2, location3, location4];
window.location = pwLocation[i];

Creating Login page using javascript is not secure because since javascript is client side scripting, any user can see what the code looks like using the page source, so if you need to make login pages you better learn Server side scripting languags like PHP.

To answer you question :

Use if statment to redirect each user to specific page based on their user name , for example if username is jamson then redirect jamson to his own page using the location where his page is found.
still this method is ardous if you have thousandth of users.

html – Javascript Login Page

I wouldnt do this via JavaScript. Its highly insecure as users can view-source, and can find a list of usernames.

To answer your question though, change the line that says: window.location =;, to window.location = un.toLowerCase()+.html;.

Leave a Reply

Your email address will not be published. Required fields are marked *