J
James E Middleton
I am currently using this simple asp script to password protect a few pages
on my site.
Scroll down for my question, please...
______START_____________________________
<% Response.Buffer=true %>
<% If Request.Form("pw") = "SECURE" Then %>
<% Else
Response.Write "To view this page, enter a valid password." & _
"<FORM ACTION=""thispage.asp"" METHOD=""POST"">" & _
"<INPUT SIZE=10 TYPE=""password"" NAME=""pw"">" & _
"<INPUT TYPE=""submit"" NAME=""Submit"" VALUE=""Go"">" & _
"</FORM>"
End If %>
______END______________________________
______HOW IT WORKS___________________
Before the first line of code:
<% Response.Buffer=true %>
On the line following the first <body> tag: (Change SECURE to your own
password.)
<% If Request.Form("pw") = "SECURE" Then %>
Find the closing </body> tag, add one line before it. Beginning on the new
line you just created:
<% Else
Response.Write "To view this page, enter a valid password." & _
"<FORM ACTION=""thispage.asp"" METHOD=""POST"">" & _
"<INPUT SIZE=10 TYPE=""password"" NAME=""pw"">" & _
"<INPUT TYPE=""submit"" NAME=""Submit"" VALUE=""Go"">" & _
"</FORM>"
End If %>
Change 'thispage.asp' to the page you want to open.
______WHAT I'D LIKE___________________
OK, it's simple and I want to keep it simple. I do not want to use a data
base, create user accounts, have a log-in system, etc. It does exactly what
I want; I'm not guarding military secrets or any thing like that.
However, I would like to be able to edit the 'form' that comes up for the
password prompt. When users click on a link to the protected page a blank
page comes up with the message "To view this page, enter a valid password."
Users enter the password ant the protected page is displayed.
I can edit the 'Response.Write' line to what ever text I want, but I can't
figure out how to change the font size or alignment, etc.
Is there a way to do that with the script I've posted, or does anyone know
of a script that will allow me to do this.
I've Googled and got back about 1,000,000 hits for ASP password protection.
so I thought I'd post here and see if anyone could help me before I finish
going through the other 999,950 pages I haven't looked at yet. :-(
Thanks!
on my site.
Scroll down for my question, please...
______START_____________________________
<% Response.Buffer=true %>
<% If Request.Form("pw") = "SECURE" Then %>
<% Else
Response.Write "To view this page, enter a valid password." & _
"<FORM ACTION=""thispage.asp"" METHOD=""POST"">" & _
"<INPUT SIZE=10 TYPE=""password"" NAME=""pw"">" & _
"<INPUT TYPE=""submit"" NAME=""Submit"" VALUE=""Go"">" & _
"</FORM>"
End If %>
______END______________________________
______HOW IT WORKS___________________
Before the first line of code:
<% Response.Buffer=true %>
On the line following the first <body> tag: (Change SECURE to your own
password.)
<% If Request.Form("pw") = "SECURE" Then %>
Find the closing </body> tag, add one line before it. Beginning on the new
line you just created:
<% Else
Response.Write "To view this page, enter a valid password." & _
"<FORM ACTION=""thispage.asp"" METHOD=""POST"">" & _
"<INPUT SIZE=10 TYPE=""password"" NAME=""pw"">" & _
"<INPUT TYPE=""submit"" NAME=""Submit"" VALUE=""Go"">" & _
"</FORM>"
End If %>
Change 'thispage.asp' to the page you want to open.
______WHAT I'D LIKE___________________
OK, it's simple and I want to keep it simple. I do not want to use a data
base, create user accounts, have a log-in system, etc. It does exactly what
I want; I'm not guarding military secrets or any thing like that.
However, I would like to be able to edit the 'form' that comes up for the
password prompt. When users click on a link to the protected page a blank
page comes up with the message "To view this page, enter a valid password."
Users enter the password ant the protected page is displayed.
I can edit the 'Response.Write' line to what ever text I want, but I can't
figure out how to change the font size or alignment, etc.
Is there a way to do that with the script I've posted, or does anyone know
of a script that will allow me to do this.
I've Googled and got back about 1,000,000 hits for ASP password protection.
so I thought I'd post here and see if anyone could help me before I finish
going through the other 999,950 pages I haven't looked at yet. :-(
Thanks!