Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


how to create login in website?

Posted on 2004-11-25
Medium Priority
Last Modified: 2011-10-03
what do i need to do if i want to create a website for the user to login in?
Question by:tancy1

Expert Comment

ID: 12679480

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.


Author Comment

ID: 12679765
i planning to use html. can i know the concept"?

Expert Comment

ID: 12679809
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:


Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 12679856

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.


Expert Comment

ID: 12680379
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
LVL 19

Expert Comment

ID: 12682425
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.
LVL 19

Expert Comment

ID: 12682436
A good sample code for MySQL and ASP.Net can be found here: http://www.brinkster.com/CodeBank/ShowSnippet.aspx?n2129

Accepted Solution

terminator_III earned 320 total points
ID: 12687329
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.




Expert Comment

ID: 12689740
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 asp.net 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>


Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
Simple Linear Regression

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question