Click here to Skip to main content
11,798,546 members (73,563 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: HTML
i have created a simple html page with (username and password)field and a login button.
my username and password are i dont want to use any database.
how should i authenticate that when i click the login button?
Posted 10-Jan-13 20:29pm
Edited 10-Jan-13 20:30pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The only way to do this is by javascript. But if you do it in javascript there is virtually no use of this user id and password as the javascript will also be pushed to the client and anyone can see the user id and password and log in.

So what I am trying to say is that, if you dont have a server side technology to store the user credentials, even if you implement this functionality, it will actually be futile.
Sohushah at 11-Jan-13 5:16am
i have done it like this:
<form id="form01" class="form-horizontal" action="index.jsp" method="post">
Login Here
<div class="control-group">
<label class="control-label" for="username">Username</label>
<div class="controls">
<input type="text" class="input-xlarge" name="username" id="username" value="XYZ">
<div class="control-group">
<label class="control-label" for="password">Password</label>
<div class="controls">
<input type="password" class="input-xlarge" name="password" id="password" value="xyz">
<div id="alert"></div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Login</button>
so now i want that if username and password are different or modified then no one should be able to login.
Rahul Rajat Singh at 11-Jan-13 5:19am
Where are you planning to store your username and password?
Sohushah at 11-Jan-13 6:07am
it's just a single user application. i would provide that in value attribute of input.
so i don't need to save it.
but in case it is modified by mistake by him while running the aplication then even he should not be able to login.
Rahul Rajat Singh at 11-Jan-13 6:09am
ok, So i am not the authentic user of your website but i go to your website and do a "View source" and BAAM, I have the user id and password written there. So did you see my point on how it is wrong to do this way.
Sohushah at 11-Jan-13 6:49am
k sorry dear i didn't mentioned. but i m making a desktop application.
i got your point.
but i m not worried about that.
u please tell me how do i stop logging if that fixed username or password is modified.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 585
1 Maciej Los 395
2 OriginalGriff 348
3 Abhinav S 257
4 phil.o 254
0 OriginalGriff 2,150
1 Maciej Los 1,790
2 KrunalRohit 1,456
3 CPallini 1,415
4 Richard MacCutchan 1,016

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100