Webpage Password

Posted on 2012-09-17
Last Modified: 2012-10-16
Would like to request a pin number for a person to have access to a webpage.  Is this something that can be placed into the pages .html>  Thanks
Question by:akbiro

    Author Comment

    This is the code I am trying to get to work.  I think I have missed something.  Can someone take a look and see what I screwed up?  Thanks

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns="" lang="en" xml:lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Login and Password script</title>
    <table bgcolor="white" cellpadding="12" border="1">
      <tr><td colspan="2"><center><h1><i><b>Login
      <tr><td><h1><i><b>Pin No:</b></i></h1></td><td><input name="pass"
    <tr><td><center><input type="button" value="Login"
    onClick="pasuser(this.form)"></center></td><td><center><br /><input
    type="Reset"></form></td></tr></table></center> <!--webbot
    bot="HTMLMarkup" endspan --></strong></p>
    <div id="footerarea">
      <script src="" type="text/javascript">
      <script type="text/javascript">
    _uacct = "UA-55377-1";

    <script language="javascript">
    /*This Script allows people to enter by using a form that asks for a
    UserID and Password*/
    function pasuser(form) {
    if (form.pass.value=="5801316") {              
    LVL 16

    Accepted Solution

    What you are presenting here provides no security at all, any one can simply view the source of your HTML / JavaScript and read the value for the password.

    To protect a website the password must be checked server-side (using a scripting langauge such as PHP or ASP).

    If you do not have server-side scripting expertise, then you can use HTTP Authentication to protect a directory, in to which you would place the page that calls your Google Analytics.

    Some easy to follow "how to" examples:

    Author Comment

    Is it possible to make what I have tried to do work?  Is it something simple?  I do not have PHP service on my server, I do have .asp, but I just need something simple...not really that important for it to be that secure.  Thanks
    LVL 16

    Expert Comment

    If you are prepared to accept "low security" then you could use:

    Author Closing Comment


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Hi there, This article summarizes what you need if you are going to set up your home or small business Network Attached Storage (NAS) to be accessible from the internet. Of course there are configuration differences based on your NAS or router ma…
    When designing and editing page layouts in inDesign, fonts can become messy without the help of paragraph styles. How many times have you re-read through a document you created and noticed a sentence in the middle of a paragraph happened to be a dif…
    Learn how to automatically add page numbers in your next InDesign project. This can be very helpful in multi-page books and magazines that you are designing. Make sure your Pages window visible.:  In the document you wish to add page numbers to. Act…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    732 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

    20 Experts available now in Live!

    Get 1:1 Help Now