Solved

Front Page 2000 Problem with Password Restriction

Posted on 2004-04-19
7
416 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
  • 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

758 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

21 Experts available now in Live!

Get 1:1 Help Now