|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i want to develop a web using HTML. This web require user to login using username n password, or for new user, they are able to register a new account. How could i using html to develop such a web?? could someone advise me? Thanks!
Regards Shanny |
|
#2
|
|||
|
|||
|
This cannot be done with HTML alone.You need to take the help of JavaScript or ASP or some script language.With HTML you can create the forms but validation of those forms need to be done for further processes.I prefer ASP as it's a secure way.Even javascript can be used.
|
|
#3
|
||||
|
||||
|
Here is a simple login implementation with ASP although it just assumes the users are already in the underlying database:
ASP Design Tips - Login Page http://www.bullschmidt.com/devtip-loginpage.asp
__________________
J. Paul Schmidt www.Bullschmidt.com - Freelance Web and Database Developer www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips |
|
#4
|
|||
|
|||
|
Try this. Create a html page with the following form on it.
<form action="login_auth.asp" method="post"> <table> <tr><td> Password: </td> <td> <input type="password" size="20" name="password"> </td> </tr> </table> <input type="submit" value="Login"> </form> Then create the login_auth.asp page specified in the ACTION attribute above. Add the following code to it. <% ' Declaring variables Dim password, AdminUser ' A Function to check if the field entered by user is empty Function ChkString(string) If string = "" Then string = " " ChkString = Replace(string, "'", "''") End Function ' Receiving values from Form password = ChkString(Request.Form("password")) ' Hard coding the password If Request.Form("password") = "thisisthepassword" Then session("AdminUser")=true Else session("AdminUser")=false End If If session("AdminUser")=true Then response.write("<a href=http://www.yourdomain.com/adminmode.html>Click here to enter Admin mode</a>") Else response.write("LOGIN FAILED!<p> </p>You either mis-typed the password or you are not an administrator.") End If %> This example hard codes the password (displayed in red above). Thanks Steve |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Login coding |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|