Click here to Skip to main content
Rate this: bad
good
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 fixed.so i dont want to use any database.
how should i authenticate that when i click the login button?
Posted 10-Jan-13 21:29pm
Edited 10-Jan-13 21:30pm
v2

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
Sohushah at 11-Jan-13 5:16am
   
i have done it like this:
<form id="form01" class="form-horizontal" action="index.jsp" method="post">
<fieldset>
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>
</div>
<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>
</div>
<div id="alert"></div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Login</button>
</div>
</fieldset>
</form>
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.
.....so 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 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 319
2 CPallini 275
3 DamithSL 214
4 Maciej Los 185
0 OriginalGriff 5,455
1 DamithSL 4,457
2 Maciej Los 3,885
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,115


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 11 Jan 2013
Copyright © CodeProject, 1999-2014
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