Solved

Front Page 2000 Problem with Password Restriction

Posted on 2004-04-19
7
435 Views
Last Modified: 2013-12-24
Hi Experts!

I am having some trouble with Front Page Passwords, and I am hoping that you can help!

I have a simple survey that I created in Front Page.  However, I need to first have the potential users enter a generic, universal passcode in order to gain access to the site.  (This is to keep the responses limited to those who receive requests).  

What I tried:

My thought was to set up a page that simply requests the passcode ("Survey2004") in a simple textbox.  I set up the textbox to only accept responses equal to "Survey2004".  Upon entering the correct passcode, they should be taken them to the survey.  Upon entering the wrong passcode, I set up the confirmation page to  tell them that their passcode is wrong and please try again.  

What happened:

1.  Upon entering the right passcode, the user is directed to a page other than the survey. ???
2.  Upon entering the wrong passcode, a messagebox appears that tells them what the password should be.  ???
3.  Upon leaving the passcode empty, they are directed to the confirmation page that tells them that their passcode is wrong and please try again.  ???

I look forward to hearing from you about how to fix this issue.  The timeframe involved is certainly tight.  

Thanks in advance!  --Ren


0
Comment
Question by:Ren
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 10864413
Need code :-)
Please post the script you're using to accomplish this (ASP, etc.)

Thanks,
Sean
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10864786
This is a great KB article that provides code and all to create the pages you are attempting to create.

Use Simple ASP Code to Password Protect Your ASP Pages
http://support.microsoft.com/default.aspx?scid=kb;en-us;301464

RCMB
0
 
LVL 12

Accepted Solution

by:
rcmb earned 250 total points
ID: 10867835
Here another example of how to accomplish this:

Create 4 new pages in the same directory
Page 1
Filename = login.asa (recommend creating notepad and importing into FrontPage)
Contents of file:
<%
' Username and password are set here:
Username="Survey2004"
Password="password"
%>
Page 2
Filename = login.asp
This is the file that contains the login form
Contents of file (switch to html view and delete everything FrontPage puts there and insert the following code)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Results -- Login</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="1-blank 111">
</head>

<body background="../../_themes/1-blank/blbkgnd.gif" bgcolor="#CCCCCC" text="#000000" link="#003399" vlink="#993300" alink="#336633"><table width="100%" align=left>
  <tr>
    <td width="100%">
        <p align="center">
        <b><font size=+3 color="#000080"> Survey 2004 Login </font></b>
      </td>
  </tr>
</table>

<br clear=all>

<hr>

<FORM ACTION="Login_Validate.asp" METHOD="POST">

<p>
<div align="center">
  <center>
<TABLE BORDER=4 cellpadding="6" cellspacing="5" bordercolordark="#000000" bordercolorlight="#999999">      
      <TR>
            <TD ALIGN="right">Username:</TD>
            <TD><INPUT TYPE="text" NAME="login" size="10" VALUE='<%=Request.Cookies("ADMIN")("login")%>'></INPUT></TD>
      </TR>
      <TR>
            <TD ALIGN="right">Password:</TD>
            <TD><INPUT TYPE="password" NAME="password" size="10" VALUE='<%=Request.Cookies("ADMIN")("pass")%>'></INPUT></TD>
      </TR>
      <TR>
        <TD colspan="2">
          <p align="center">&nbsp;
          &nbsp;
              <INPUT TYPE="submit" VALUE="Login"></INPUT> </TD>
      </TR>
      </TABLE>
  </center>
</div>
</FORM>

<p>&nbsp;</p>

</body>
</html>
Page 3
Filename = login_check.asp
Contents of file (switch to html view and delete everything FrontPage puts there and insert the following code):
<!--#include file="login.asa"-->

<%
' Security check for cookie on local workstation vs. login and password

' if cookie do not match, redirect user
If Request.Cookies("ADMIN")("login") <> Username or Request.Cookies("ADMIN")("pass") <> Password Then
      ' redirect user to login page
       Response.Redirect "login.asp"            
End If
' End security check, proceed with browsing
%>
Page 4
Filename = login_validate.asp
Contents of file (switch to html view and delete everything FrontPage puts there and insert the following code):
<!--#include file="login.asa"-->

<%
' if any of the variables do not match, create error message
if Request.Form("login") <> Username OR Request.Form("password") <> Password then
       MsgErr = "<h3>Authorization Failed.</h3>" & "<br>" & "<a href=login.asp>Please try again.</a>"
       Response.Write MsgErr

' if correct, set cookie on workstation and proceed
Else
         Response.Cookies ("ADMIN")("pass") = Request.Form("password")
         Response.Cookies ("ADMIN")("login") = Request.Form("login")

' cookie expiration (can be changed) we don't use this field here because we only
' want the cookie to exist for this session
'         Response.Cookies ("ADMIN").Expires = DATE + 1

' redirect to default page.
         Response.Redirect "new_page_1.asp"

End if
%>

<meta name="Microsoft Theme" content="1-blank 111">
<body background="../../_themes/1-blank/blbkgnd.gif" bgcolor="#CCCCCC" text="#000000" link="#003399" vlink="#993300" alink="#336633">

On page 4 set the page you want users to view the Survey --- replace new_page_1.asp with your filename
At the top of your Survey page (above the <html> tag) insert <!--#include file="login_check.asp"-->
On your home page create a link to your survey page and when they click the link, if the have not logged in for this session they will be prompted for the username and password you set in the login.asa file. You will need to save your Survey page as an asp page.

Little bit of work here but I have done the code for you and this works very well.

RCMB
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
LVL 31

Expert Comment

by:seanpowell
ID: 10868060
That's pretty sweet code :-)
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10868094
Thanks for the feedback. I use this frequently but it is limited to a single login and password.

Have a great day!

Curtis (aka RCMB)
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 10868106
Well - since the question states:
I need to first have the potential users enter a generic, universal passcode

I think you hit it on the nose. Thanks Curtis :-)
0
 

Author Comment

by:Ren
ID: 10870192
That was exactly what I needed.  

Thanks for your help!

--Ren
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

729 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