Solved

Front Page 2000 Problem with Password Restriction

Posted on 2004-04-19
7
427 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
importing  maven Project 5 289
create a website 10 78
How to setup a password to enter my web page? 3 112
move expression web site to a new server 13 39
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…
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

825 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