Solved

Front Page 2000 Problem with Password Restriction

Posted on 2004-04-19
7
420 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
google maps v3 custom icon 9 132
HTTPS upload and download website building help 4 39
About Wordpress website 3 102
Web Development Tools for MVC 3 75
When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
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 prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

867 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

19 Experts available now in Live!

Get 1:1 Help Now