How to password protect Form web pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web site that is password protected and available to members of our
high school class only. I password protected the site using MS FrontPage
2003 Article ID 825498.

I have several forms on the site that I use to collect information for our
classmates. These forms were made using the FrontPage 2003's Form Page
Wizard and Feedback Form wizard. These pages work with an extension of
..html or .htm but not with a .asp extension, therefore I can not password
word protect them by using a .asp extension and the vbscript include used on
the other pages.

I have searched the net and can not find samples of how I can create the
forms and password protect them. I am converting the site to use MS
Expression Web 2 instead of FP 2003.

Does anyone have any ideas on where I can find some sample code on how to
create the forms and password protect them without having to change the way
I have the password protection currently set up? This is the code I place
on each page that is password protected and has a .asp extension. <%
@language="vbscript" %>
<!--#include virtual="/classsite/_private/logon.inc"-->.

Any help would be greatly appreciated.

Lee Steele
 
The FP Form handle only works with HTML pages

Check which server side forms handler your host supports
- CDOSYS (preferred) or CDONTS
For an example using CDONTS see
http://www.devasp.com/Samples/Mail.asp
For an example using CDOSYS see
http://www.w3schools.com/asp/asp_send_email.asp

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


|I have a web site that is password protected and available to members of our
| high school class only. I password protected the site using MS FrontPage
| 2003 Article ID 825498.
|
| I have several forms on the site that I use to collect information for our
| classmates. These forms were made using the FrontPage 2003's Form Page
| Wizard and Feedback Form wizard. These pages work with an extension of
| .html or .htm but not with a .asp extension, therefore I can not password
| word protect them by using a .asp extension and the vbscript include used on
| the other pages.
|
| I have searched the net and can not find samples of how I can create the
| forms and password protect them. I am converting the site to use MS
| Expression Web 2 instead of FP 2003.
|
| Does anyone have any ideas on where I can find some sample code on how to
| create the forms and password protect them without having to change the way
| I have the password protection currently set up? This is the code I place
| on each page that is password protected and has a .asp extension. <%
| @language="vbscript" %>
| <!--#include virtual="/classsite/_private/logon.inc"-->.
|
| Any help would be greatly appreciated.
|
| Lee Steele
|
 
Thanks Stefan.
My hosting service (godaddy.com) uses CDOSYS. Do you know where I could
find a sample ASP form where the response is sent via email using CDOSYS?
I've found several sites that use one or the other, but have found none that
show a sample of both.

Thanks again.
Lee Steele
 
Either:
http://www.veign.com/code-view.php?type=web&codeid=21

or:
http://www.veign.com/code-view.php?type=web&codeid=38

--
Chris Hanscom - Microsoft MVP
Resource Center: http://www.veign.com/development-center.php
Veign's Blog: http://www.veign.com/blog
--
Web Development Help: http://www.veign.com/development-center-web.php
--


Thanks Stefan.
My hosting service (godaddy.com) uses CDOSYS. Do you know where I could
find a sample ASP form where the response is sent via email using CDOSYS?
I've found several sites that use one or the other, but have found none
that show a sample of both.

Thanks again.
Lee Steele

Stefan B Rusynko said:
The FP Form handle only works with HTML pages

Check which server side forms handler your host supports
- CDOSYS (preferred) or CDONTS
For an example using CDONTS see
http://www.devasp.com/Samples/Mail.asp
For an example using CDOSYS see
http://www.w3schools.com/asp/asp_send_email.asp

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


|I have a web site that is password protected and available to members of
our
| high school class only. I password protected the site using MS
FrontPage
| 2003 Article ID 825498.
|
| I have several forms on the site that I use to collect information for
our
| classmates. These forms were made using the FrontPage 2003's Form Page
| Wizard and Feedback Form wizard. These pages work with an extension of
| .html or .htm but not with a .asp extension, therefore I can not
password
| word protect them by using a .asp extension and the vbscript include
used on
| the other pages.
|
| I have searched the net and can not find samples of how I can create
the
| forms and password protect them. I am converting the site to use MS
| Expression Web 2 instead of FP 2003.
|
| Does anyone have any ideas on where I can find some sample code on how
to
| create the forms and password protect them without having to change the
way
| I have the password protection currently set up? This is the code I
place
| on each page that is password protected and has a .asp extension. <%
| @language="vbscript" %>
| <!--#include virtual="/classsite/_private/logon.inc"-->.
|
| Any help would be greatly appreciated.
|
| Lee Steele
|
 
Chris,
Thanks for your reply.

What I'm looking for is a sample form with the email capability already
built in. I am a relative newbie when it comes to using FP or EW. I know
enough to be able to modify existing forms, but to build one from scratch
and add the email capability is beyond my skill level.

Thanks again.

Lee Steele

Veign said:
Either:
http://www.veign.com/code-view.php?type=web&codeid=21

or:
http://www.veign.com/code-view.php?type=web&codeid=38

--
Chris Hanscom - Microsoft MVP
Resource Center: http://www.veign.com/development-center.php
Veign's Blog: http://www.veign.com/blog
--
Web Development Help: http://www.veign.com/development-center-web.php
--


Thanks Stefan.
My hosting service (godaddy.com) uses CDOSYS. Do you know where I could
find a sample ASP form where the response is sent via email using CDOSYS?
I've found several sites that use one or the other, but have found none
that show a sample of both.

Thanks again.
Lee Steele

Stefan B Rusynko said:
The FP Form handle only works with HTML pages

Check which server side forms handler your host supports
- CDOSYS (preferred) or CDONTS
For an example using CDONTS see
http://www.devasp.com/Samples/Mail.asp
For an example using CDOSYS see
http://www.w3schools.com/asp/asp_send_email.asp

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


|I have a web site that is password protected and available to members
of our
| high school class only. I password protected the site using MS
FrontPage
| 2003 Article ID 825498.
|
| I have several forms on the site that I use to collect information for
our
| classmates. These forms were made using the FrontPage 2003's Form
Page
| Wizard and Feedback Form wizard. These pages work with an extension
of
| .html or .htm but not with a .asp extension, therefore I can not
password
| word protect them by using a .asp extension and the vbscript include
used on
| the other pages.
|
| I have searched the net and can not find samples of how I can create
the
| forms and password protect them. I am converting the site to use MS
| Expression Web 2 instead of FP 2003.
|
| Does anyone have any ideas on where I can find some sample code on how
to
| create the forms and password protect them without having to change
the way
| I have the password protection currently set up? This is the code I
place
| on each page that is password protected and has a .asp extension. <%
| @language="vbscript" %>
| <!--#include virtual="/classsite/_private/logon.inc"-->.
|
| Any help would be greatly appreciated.
|
| Lee Steele
|
 
Chris,
Thanks for your reply.

What I'm looking for is a sample form with the email capability already
built in. I am a relative newbie when it comes to using FP or EW. I know
enough to be able to modify existing forms, but to build one from scratch
and add the email capability is beyond my skill level.

Thanks again.

Lee Steele
Try study this page. Especielly the lower part of the page
http://www.w3schools.com/asp/asp_inputforms.asp
You can still use your original forms.
In your forms you will have to set the action to the name of your
asp function: action = msgFromMyUser.asp
This asp function could be one like the one you got from Veign
Put the form input-names into the subject and body of this
asp function, because, when your user submit,
the inputs is sent to the function msgFromMyUser.asp
Where the names are changed with the content.
(mail to: yourself).
You see the idea.
 
Adding to Sean.

When ever you have a question about any web technology check out the
tutorials at W3schools.com. They are written with newbies in mind and are a
create place to get a starting foundation for most of common web
technologies.
 
Thanks to both of you. I'll see what I can figure out with that
information.

Lee Steele
 
Chris - Sean,

After reading these messages and the code from Chris, I have a couple of
questions. I take it the cSendMail.asp is a separate page and will be
called using the action = msgcSendMail.asp. I assume I would have to rename
my form to match the names shown here in the .To, .From, .subject and
..TextBody. and if I had other form fields I could just add the form names to
..TextBody.
'Populate the message
With objMsg
'Email Details
.To = mToEmail
.From = mFromEmail
.Subject = mSubject

'Optional
'.Bcc = "(e-mail address removed)"

'Populate the body
.TextBody = mBody 'Plain text format
'.HTMLBody = mBody 'HTML format

'Send the email
.Send
End With
Are my assumptions correct?

Thanks
Lee Steele
 
Chris - Sean,

After reading these messages and the code from Chris, I have a couple of
questions. I take it the cSendMail.asp is a separate page and will be
called using the action = msgcSendMail.asp. I assume I would have to
rename my form to match the names shown here in the .To, .From, .subject
and .TextBody. and if I had other form fields I could just add the form
names to .TextBody.
'Populate the message
With objMsg
'Email Details
.To = mToEmail
.From = mFromEmail
.Subject = mSubject

'Optional
'.Bcc = "(e-mail address removed)"

'Populate the body
.TextBody = mBody 'Plain text format
'.HTMLBody = mBody 'HTML format

'Send the email
.Send
End With
Are my assumptions correct?

Thanks
Lee Steele

It's best wait for an answer from another one as I only used php
in formmails. I think you'll have to use the reguest object as below.
For example, if you have an asp page of the name "usersFormMail.asp"
in the root folder with the content below, I think that'll do.
The names msubject, usersMailaddress and mtext is the names of
the input textboxes in your form
and let the action = usersFormMail.asp

Alternate, the reguest object should be build into the function
of Veigns. Let him tell you how you best can do this.

<%
Set mMail=CreateObject("CDO.Message")
With mMail
.Subject = request.form("msubject")
.From= request.form("usersMailaddress")
.To="yourOwnMailAddress"
.TextBody = request.form("mtext")
.Send
End With
set myMail=nothing
%>
 
I don't do anything with ASP anymore. This is where you would need to do
some reading on Forms and the basic of ASP. The function I provided would
simply be called from your form processing page.
 
Thanks to both of you for your help and comments. I'll see what I can do.

Lee Steele
Try read up on it here. It reveals a use of two pages. One html-page
with the form-code. And one asp-page. Both in the same directory
The name of the asp-page in the forms action.
You don't need to use the reguest object in mail.to
Instead write this:
mail.to = "yourname" & "@" & "yourdomain.com"
http://www.tizag.com/aspTutorial/aspFormsEmail.php
 
Senn,
I tried using the code in the link you gave me. I pasted the html code into
an existing template http://www.leesteele.info/classof62/newform.htm and the
asp code into a new blank page, located at
http://www.leesteele.info/classof62/Email.asp. When I click submit on the
newform.htm form, I get the following error:

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/classof62/Email.asp, line 18

The code on line 18 is identical to what is in the sample code. I thought I
would try to use the code as written before trying to modify anything. Do
you have any idea why this does not work?

By the way, my hosting firm is GoDaddy.com. I have FPE activated and am
using IIS 6 on the hosting server.

Thanks

Lee Steele
 
Senn,
I tried using the code in the link you gave me. I pasted the html code
into an existing template http://www.leesteele.info/classof62/newform.htm
and the asp code into a new blank page, located at
http://www.leesteele.info/classof62/Email.asp. When I click submit on the
newform.htm form, I get the following error:

CDO.Message.1 error '80040220'
The "SendUsing" configuration value is invalid.
/classof62/Email.asp, line 18

The code on line 18 is identical to what is in the sample code. I thought
I would try to use the code as written before trying to modify anything.
Do you have any idea why this does not work?

By the way, my hosting firm is GoDaddy.com. I have FPE activated and am
using IIS 6 on the hosting server.

Thanks

Lee Steele

I cannot see your asp code. You should post it.
But, I'm almost sure this is a configuration problem. There's a huge
amount of this topic found on google. Unfortunately, the config. seems
to change over time. Try to add this Configuration shown below,
except the first part inside <!-- --> skip this in the first trial. As
a Windows 2000 Library must be to old.
About mail.server_name. See the name in Outlook (or your mail setup program)
under smtp outgoing server name.


<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
..Item(cdoSendUsingMethod) = cdoSendUsingPort
..Item(cdoSMTPServer) = "<enter_mail.server_here>"
..Update
End With

Dim mail
Set mail = Server.CreateObject("CDO.Message")
With mail
.To = Request.Form("To")
.From = Request.Form("From")
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
.Send()
End With
Response.Write("Mail Sent!")
Set mail = nothing
Set cdoConfig = nothing
%>

/senn
 
Thanks Senn,

Here is the code from the email.asp page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
<%
'Sends an email
Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.To = Request.Form("To")
mail.From = Request.Form("From")
mail.Subject = Request.Form("Subject")
mail.TextBody = Request.Form("Body")
mail.Send()
Response.Write("Mail Sent!")
'Destroy the mail object!
Set mail = nothing
%>

</body>

</html>

Lee Steele
 
Did it work with the configuration I sent you.?
When adding the configuration, remember to add
Set cdoConfig = nothing
next to Set mail = nothing
/senn
 
Senn,

I got an error using the code you sent me:
ADODB.Fields error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/classof62/Email.asp, line 14

Below is the code in the email.asp page: Line 14 is
..Item(cdoSendUsingMethod) = cdoSendUsingPort



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
..Item(cdoSendUsingMethod) = cdoSendUsingPort
..Item(cdoSMTPServer) = "relay-server.secureserver.net"
..Update
End With

Dim mail
Set mail = Server.CreateObject("CDO.Message")
With mail
.To = Request.Form("To")
.From = Request.Form("From")
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
.Send()
End With
Response.Write("Mail Sent!")
Set mail = nothing
Set cdoConfig = nothing
%>

</body>

</html>

I tried changing the email server to read smtpout.secureserver.net from
relay-server.secureserver.net and that did not help. Godaddy.com had
information on using the relay-secure.secureserver.net on cdosys mailers.
The smtpout.securesever.net is the correct outbound for email.

Any other ideas?
--
Lee Steele
949 Chevy Chase St NW
Port Charlotte FL 33948-3628
Home (941) 743-2304
Cell (941) 286-1950
(e-mail address removed)
 
Senn,

I got an error using the code you sent me:
ADODB.Fields error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/classof62/Email.asp, line 14

Below is the code in the email.asp page: Line 14 is
.Item(cdoSendUsingMethod) = cdoSendUsingPort

Then try insert the Library the way I did - below.
In the meanwhile, I will take a look at the MSDN if any
other newer Library for XP or Vista.
Some of the regulars here is watching this tread and know how
to handle this. But no responce.!.
/senn


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "relay-server.secureserver.net"
.Update
End With

Dim mail
Set mail = Server.CreateObject("CDO.Message")
With mail
.To = Request.Form("To")
.From = Request.Form("From")
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
.Send()
End With
Response.Write("Mail Sent!")
Set mail = nothing
Set cdoConfig = nothing
%>
</body>
</html>
 
Back
Top