?
Solved

Front Page 2000 Problem with Password Restriction

Posted on 2004-04-19
7
Medium Priority
?
437 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 1000 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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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…
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…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
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…
Suggested Courses

752 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