This is a discussion on "Login Code" within the JavaScript Forum section. This forum, and the thread "Login Code are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Login Code
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Login Code
I have a website I am building for school. It is done in Frontpage.. ya go ahead and laugh but I had no choice. I would like to add a login for members of the site and I found a code in javascript that works for one name and password but I'm not sure how to add more names and passwords.. what I have tried hasn't worked. Does anyone have a code or know how to add to this one?? Any help would be appreciated.
function authUser(form) { if (form.Username.value=="kookie09") { if (form.Password.value=="flossy") { location="Local Clubs.htm" } else { if (form.Username.value=="giggen") { if (form.Password.value=="celica") { location="Local Clubs.htm" } else { location="UnAuthorized.html" } } else { location="UnAuthorized.html" } } |
|
|
|
||||
|
You definitly DO NOT want to use javascript for 'login' functionality.
This is because anyone hitting 'view -> source' will see the usernames and passwords. You really want some sort of SERVER SIDE scripting for this. Javascript login scripts are unheard of... simply because they offer no security what-so-ever.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Re: Login Code
Quote:
It's a jolly bad idea as rob says. Rather like hiding your key under the door mat. Anyone who wanted to break in would have a quick look there, just to see if you were really careless enough with your security to leave it there. |
|
|||
|
thanks
Rob-Well... I'm not too concerned about security, its only for show for the class and if I ever host it live I wont have a login or anything but that is a very useful tip. I will have to keep that in mind for future. Lots more studying to do lol.
GillBates-I'm just doing a very wasteful Computer Systems Technician course at the local college. I realised too late its a big waste of money for what I'm getting out of it and will have to head to Waterloo or U of T when I find financing. |
|
||||
|
u dont need money to learn this stuff.
i think most of the users of this website, and in fact most of really good web-dudes out there are self-taught. just stick around and you'll pick it up... btw: GillBates, you crack me up! love you site! 8)
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
Never use this, veiw source will let people bypass it as previously mentioned, however:
|
![]() |
| Tags |
| login, code |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| code behind code doesnt work | skat | ASP.NET Forum | 4 | Feb 18th, 2008 10:05 |
| PHP Login | Jack Franklin | PHP Forum | 25 | Oct 10th, 2007 09:27 |
| live search code and styleswitcher code | hebel | JavaScript Forum | 0 | May 12th, 2007 06:16 |
| Php login | cbrams9 | PHP Forum | 1 | Sep 14th, 2006 22:05 |
| Can somebody give me the code to hide the source code? | renren | JavaScript Forum | 7 | Mar 7th, 2006 12:27 |