how to create login in website?

Posted on 2004-11-25
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
    LVL 3

    Expert Comment


    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

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

    Expert Comment

    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:

    LVL 8

    Expert Comment


    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.

    LVL 1

    Expert Comment

    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

    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

    A good sample code for MySQL and ASP.Net can be found here:
    LVL 2

    Accepted Solution

    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

    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>


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    only14 challenge 19 57
    fizzArray3  challenge 1 47
    wordappend challenge 8 54
    Looking for example pivot year code used in Y2K 4 17
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    This article will show, step by step, how to integrate R code into a R Sweave document
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now