how to create login in website?

what do i need to do if i want to create a website for the user to login in?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Could you please give us more details as in what technology you intend to use, what Web Server or what OS you are planning to deploy and the level of security u need, and that would have experts here help you. In case you havent decided on this yet, to start with you can look up ASP .NET which has highly simplified the development  of authentication mechanisms.

tancy1Author Commented:
i planning to use html. can i know the concept"?
Still, at least webserver would be nice to know, and OS wouldn't be too bad either.

An easy way if you use Apache is to use htaccess, I suggest following this site:

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.


Html alone will not do what you want. HTML is nothing more than a standard for formatting the display of htm/html documents or websites. Html does nothing more than describe the position of text and pictures on a webpage (of course also creates hyperlinks). As vippx asked, we need to know what type of webserver your using. If your using Microsoft's IIS, then it would be easiest for you to use ASP (active server pages), and if your using a webserver like Apache then you should use PHP or CGI to handle the server-side processing, which will handle logins, account setup, ect..

HTML only formats stuff on webpages, it has no ability to process information and determine if a password or username is valid.

If you are using the apache web server then you can put and .htaccess file in the directory which will simply put the authentication check for the whole directory which will be accessed.

Gourav Jain
Though its not clear from your question, it seems that you want individual users to login to your site with different username/password. To do so, you will need to use a server side scripting language such as ASP/Php/Perl etc in combination with a database such as Access/SQL Server/MySQL/Plain text as its back-end.

Login scripts written in various languages are easily available on the net. With a little bit of search you can easily find them. But be warned, it can be difficult for you to implement even with our help, if you have no prior experience with a scripting language and awareness of database concepts.

If you want just one username/password globally for all your site visitors, follow gaurav's suggestion given above. Depending on your web server you are using, it can be done difeerently. For that you have to tell us about your web server software.

If you find all this difficult, you can implement a very primitive kind of (easily bypassable) security even with client side scritpting (JavaScript).

Please let us know what exactly you want.
A good sample code for MySQL and ASP.Net can be found here:
There are a few considerations on the above comments....

Javascripting usually requires cookies enables on the client machine to work.  This is evident on systems like ebay etc that ont allow you to login without cookies ON....  
Most php and asp systems require cookies to work.

.htaccess is available on Apache systems and some others, it does not use cookies but management of the .htpasswd files is hard for a novice! The passwords need to be stored encrypted.  There are many free htpasswd generators on the web.

If you want your website to automate signups then you have to consider whether you can handle the htpasswd generation and also your server / host must provide some scripting facilities ie PHP ASP or CGI.

If you are happy to add users manually then htaccess is the easiest way.

The links given in previous comments point to .htaccess references and should give you what you need.

For htaccess
Basically and briefly you need to copy a text file called .htaccess to your folder to protect, each and every subfolder will be protected.

The file needs to contain at a minimum:-

AuthName secure
AuthType basic
AuthUserFile /pathname/.htpasswd
Require valid-user

call it ".htaccess" the . makes apache hide it from web briwsers.

Next copy a file containing passords to the /pathname/....  specified above in htaccess file.


each user on a new line. nothing else in there.

call it ".htpasswd" ftp it to the place you told the htaccess file to find it.

To create passwords, rite a script or use this free generator   


this one

if you want me to email you a basic set of files then send me an email.




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi there
   As u have told that u want to build a login pagein HTML, here is a code for it. But for ur information, HTML only provides us a Interface.So u have to decide which language u want to use to implement it. You can use Asp or and SQL server for DB. Anyway i have just sent u the interface which is in HTML. so there is no code implemented yet for login. You have to check where it is valid user or not,whether the password entered matches or not etc. Here the HTML code which i have sent is very simple u can use logo and stylesheet to give it good look.Let me know which language u want to use for web page developemnt.


<body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0>
  <table width=100% style="cursor:default;" height=46 cellspacing=0 cellpadding=0>
     <td align=left style="vertical-align: middle;"><img src="logo-small.gif" border="0" style="vertical-align: middle;">
       &nbsp;&nbsp;<img src="one2knowweb-header.gif" border="0" style="vertical-align: middle;">&nbsp;</b></td>
 <form name="actionform" method="post" action="logon.asp">
  <input type="hidden" name="action" value="login">
   <table width="100%" cellspacing="0" cellpadding="3" border="0">
      <th align="left">Loginprocedure</th>
  <table align=center cellspacing="0" width=50% cellpadding="5">
      <th colspan="3">Login</th>
                 <td style="color:black;">UserName</td>
      <td><input type="text" name="fldUsername" value="" size="20">
      <script language=javascript>document.forms(0).fldUsername.focus()</script>
                <td  style="color:black;">Wachtwoord</td>
      <td><input type="password" name="fldPassword" value="" size="20"></td>
      <td >&nbsp;</td>
      <td ><br>
      <input type="submit" name="btnLogin" value="OK"></td>

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.