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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Webpage Password

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
0
akbiro
Asked:
akbiro
  • 3
  • 2
1 Solution
 
akbiroAuthor Commented:
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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login and Password script</title>
</head>
 
<body>
<strong>
<center>
<table bgcolor="white" cellpadding="12" border="1">
  <tr><td colspan="2"><center><h1><i><b>Login
    Area</b></i></h1></center></td></tr>
 
  <tr><td><h1><i><b>Pin No:</b></i></h1></td><td><input name="pass"
type="password"></td></tr>
<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="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
  <script type="text/javascript">
_uacct = "UA-55377-1";
urchinTracker();
</script>

<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") {              
location="page2.html"
</div>
</body>
</html>
0
 
grahamnonweilerCommented:
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:

https://github.com/plataformatec/devise/wiki/How-To:-Use-HTTP-Basic-Authentication

http://www.httpwatch.com/httpgallery/authentication/
0
 
akbiroAuthor Commented:
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
0
 
grahamnonweilerCommented:
If you are prepared to accept "low security" then you could use:

http://www.pagetutor.com/keeper/index.html
0
 
akbiroAuthor Commented:
Thanks
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now