Forums
This topic is locked
ASP and Forms: The Request object HELP PLEASE
Posted 11 Mar 2005 04:36:11
1
has voted
11 Mar 2005 04:36:11 vandiver teddy posted:
Hello, I am trying to learn how to create a simple form using asp and dreamweaver, well i paid for this tutorial and have tried it about fifty ways and it will not work for me. I keep getting a HTTP 500 Internal Server error along with 404, I am under the assumption that the webhosting company I am using supports asp. it can be found here www.nextmill.net... however inside the root folder I see no seperate areas for asp files or such. Can the htm and asp files be right next to each other in a directory?... Does the asp file need to be in the outermost directory.. I have been trying atthis for hours and well .... Thank You to anyone who can help Replies
Replied 11 Mar 2005 12:14:19
11 Mar 2005 12:14:19 Simon Martin replied:
Can you turn off Friendly HTTP error messages
Tools > Internet Options > Advanced, then you should get the real error message and line number of the error
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Can the htm and asp files be right next to each other in a directory? <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote> Answer - Yes
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Tools > Internet Options > Advanced, then you should get the real error message and line number of the error
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>Can the htm and asp files be right next to each other in a directory? <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote> Answer - Yes
Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>
Replied 11 Mar 2005 16:15:19
11 Mar 2005 16:15:19 vandiver teddy replied:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/HandleContactForm2.asp, line 17
800401f3
This is the error message i recieved..i see the error message on line 17...but i'm not sure what the rest of it means? Thanks for your help.
Server.CreateObject Failed
/HandleContactForm2.asp, line 17
800401f3
This is the error message i recieved..i see the error message on line 17...but i'm not sure what the rest of it means? Thanks for your help.
Replied 11 Mar 2005 16:18:44
11 Mar 2005 16:18:44 vandiver teddy replied:
this is the code I have on that page: HandleContactForm.asp: I will post the htm page it is coming from in the next post...thanks
<%@ Language="JavaScript" %>
<% // check that we have form data
if ( String( Request.Form( "EmailAddress" ) ) == "undefined" ) {
Response.Redirect( "ContactForm2.htm" );
}
// get all form variables as local variables
var name = Request.Form( "Name" );
var organisation = Request.Form( "Organisation" );
var emailAddress = Request.Form( "EmailAddress" );
var province = parseInt( Request.Form( "Province" ) );
var reasonForContact = Request.Form( "ReasonForContact" );
var products = String( Request.Form( "Products" ) );
var message = Request.Form( "HaveYourSay" );
// list of email addresses to send form data to, based on province selection
var deptEmailAddresses = new Array( " ", " " );
// contact email
var contactMail = Server.CreateObject( "CDONTS.NewMail" );
// plain text email
contactMail.MailFormat = 0;
contactMail.BodyFormat = 1;
// from
contactMail.From = Name + "<" + emailAddress + ">";
// to
contactMail.To = deptEmailAddresses[ province ];
// contact email body
var emailBody = "";
emailBody += "Name : " + name + "\r\n";
emailBody += "Organisation : " + organisation + "\r\n";
emailBody += "EmailAddress : " + emailAddress + "\r\n";
emailBody += "ReasonForContact : " + reasonForContact + "\r\n";
emailBody += "Products" + products + "\r\n";
emailBody += "HaveYourSay:\r\n\r\n" + message + "\r\n";
contactMail.Body = emailBody;
// send the email
contactMail.Send();
Response.Redirect( "ContactFormThanks.htm" );
%>
<%@ Language="JavaScript" %>
<% // check that we have form data
if ( String( Request.Form( "EmailAddress" ) ) == "undefined" ) {
Response.Redirect( "ContactForm2.htm" );
}
// get all form variables as local variables
var name = Request.Form( "Name" );
var organisation = Request.Form( "Organisation" );
var emailAddress = Request.Form( "EmailAddress" );
var province = parseInt( Request.Form( "Province" ) );
var reasonForContact = Request.Form( "ReasonForContact" );
var products = String( Request.Form( "Products" ) );
var message = Request.Form( "HaveYourSay" );
// list of email addresses to send form data to, based on province selection
var deptEmailAddresses = new Array( " ", " " );
// contact email
var contactMail = Server.CreateObject( "CDONTS.NewMail" );
// plain text email
contactMail.MailFormat = 0;
contactMail.BodyFormat = 1;
// from
contactMail.From = Name + "<" + emailAddress + ">";
// to
contactMail.To = deptEmailAddresses[ province ];
// contact email body
var emailBody = "";
emailBody += "Name : " + name + "\r\n";
emailBody += "Organisation : " + organisation + "\r\n";
emailBody += "EmailAddress : " + emailAddress + "\r\n";
emailBody += "ReasonForContact : " + reasonForContact + "\r\n";
emailBody += "Products" + products + "\r\n";
emailBody += "HaveYourSay:\r\n\r\n" + message + "\r\n";
contactMail.Body = emailBody;
// send the email
contactMail.Send();
Response.Redirect( "ContactFormThanks.htm" );
%>
Replied 11 Mar 2005 16:20:02
11 Mar 2005 16:20:02 vandiver teddy replied:
Here is the ContactForm2.htm page: Thanks
<html>
<head>
<title>Legacy Trail</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.content {
font-family: "Times New Roman", Times, serif;
font-size: small;
color: #523121;
text-align: justify;
}
.footer {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #FFFFFF;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape"&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.address {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: x-small;
font-style: normal;
color: #660000;
}
.form1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: bold;
color: #533221;
}
.form2 {
border: 1px double #55392D;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #523121;
}
.form3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #533221;
background-color: #FAE8D3;
border: 1px solid #533221;
}
.form4 {
border: 1px double #FEC05A;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>
<body bgcolor="FAE8D3" link="#FF9900">
<div align="center"> </div>
<div align="left"> </div>
<div align="left">
<form action="HandleContactForm2.asp" method="post" name="ContactForm2" id="ContactForm2">
<table width="600" cellspacing="4" cellpadding="0">
<tr valign="top">
<td width="200">Name:</td>
<td><input name="Name" type="text" id="Name" size="30"></td>
</tr>
<tr valign="top">
<td>Organisation:</td>
<td><input name="Organisation" type="text" id="Organisation" size="30"></td>
</tr>
<tr valign="top">
<td>Email address: </td>
<td><input name="EmailAddress" type="text" id="EmailAddress" size="30"></td>
</tr>
<tr valign="top">
<td>Province:</td>
<td><select name="Province" id="Province">
<option value="0">Eastern Cape</option>
<option value="1">Northern Cape</option>
<option value="2">Western Cape</option>
</select></td>
</tr>
<tr valign="top">
<td>Reason for contact? </td>
<td><input name="Feedback" type="radio" value="radiobutton">
Feedback<br>
<input name="Inquiry" type="radio" value="radiobutton">
Inquiry<br>
<input name="Suggestion" type="radio" value="radiobutton">
Suggestion<br>
<input name="Complaint" type="radio" value="radiobutton">
Complaint</td>
</tr>
<tr valign="top">
<td>Which products intrest you? </td>
<td><input name="ProductA" type="checkbox" id="ProductA" value="checkbox">
Product A<br>
<input name="ProductB" type="checkbox" id="ProductB" value="checkbox">
Product B<br>
<input name="ProductC" type="checkbox" id="ProductC" value="checkbox">
Product C </td>
</tr>
<tr valign="top">
<td>Have your say: </td>
<td><textarea name="HaveYourSay" cols="40" rows="6" id="HaveYourSay"></textarea></td>
</tr>
<tr valign="top">
<td> </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
<html>
<head>
<title>Legacy Trail</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<style type="text/css">
<!--
.content {
font-family: "Times New Roman", Times, serif;
font-size: small;
color: #523121;
text-align: justify;
}
.footer {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #FFFFFF;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape"&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
.address {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: x-small;
font-style: normal;
color: #660000;
}
.form1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: bold;
color: #533221;
}
.form2 {
border: 1px double #55392D;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #523121;
}
.form3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
color: #533221;
background-color: #FAE8D3;
border: 1px solid #533221;
}
.form4 {
border: 1px double #FEC05A;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
</head>
<body bgcolor="FAE8D3" link="#FF9900">
<div align="center"> </div>
<div align="left"> </div>
<div align="left">
<form action="HandleContactForm2.asp" method="post" name="ContactForm2" id="ContactForm2">
<table width="600" cellspacing="4" cellpadding="0">
<tr valign="top">
<td width="200">Name:</td>
<td><input name="Name" type="text" id="Name" size="30"></td>
</tr>
<tr valign="top">
<td>Organisation:</td>
<td><input name="Organisation" type="text" id="Organisation" size="30"></td>
</tr>
<tr valign="top">
<td>Email address: </td>
<td><input name="EmailAddress" type="text" id="EmailAddress" size="30"></td>
</tr>
<tr valign="top">
<td>Province:</td>
<td><select name="Province" id="Province">
<option value="0">Eastern Cape</option>
<option value="1">Northern Cape</option>
<option value="2">Western Cape</option>
</select></td>
</tr>
<tr valign="top">
<td>Reason for contact? </td>
<td><input name="Feedback" type="radio" value="radiobutton">
Feedback<br>
<input name="Inquiry" type="radio" value="radiobutton">
Inquiry<br>
<input name="Suggestion" type="radio" value="radiobutton">
Suggestion<br>
<input name="Complaint" type="radio" value="radiobutton">
Complaint</td>
</tr>
<tr valign="top">
<td>Which products intrest you? </td>
<td><input name="ProductA" type="checkbox" id="ProductA" value="checkbox">
Product A<br>
<input name="ProductB" type="checkbox" id="ProductB" value="checkbox">
Product B<br>
<input name="ProductC" type="checkbox" id="ProductC" value="checkbox">
Product C </td>
</tr>
<tr valign="top">
<td>Have your say: </td>
<td><textarea name="HaveYourSay" cols="40" rows="6" id="HaveYourSay"></textarea></td>
</tr>
<tr valign="top">
<td> </td>
<td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
Replied 15 Mar 2005 15:32:56
15 Mar 2005 15:32:56 Lee Diggins replied:
You best check with your host as to what email components are supported. The error you are recieving states that the CDONTS object cannot be created, so you probably find something like CDOSYS will be implemented on the server instead. If this is the case then you'll also need to know the name of the SMTP server and any login credentials.
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>
Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
<font size="1">[ Studio MX/MX2004 | ASP -> VBScript/PerlScript/JavaScript | SQL | CSS ]</font>