Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 10-Jan-13 20:30pm
v2

1 solution

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.
 
Share this answer
 
Comments
Sohushah 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 11-Jan-13 5:19am    
Where are you planning to store your username and password?
Sohushah 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 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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900