| louloulouloulou 2004-08-13, 7:14 am |
| hi,
i am trying to get the hang of asp includes, however i have hit a problem. I
have referenced a contact form via an include and its not liking it. I am
getting this error:
Microsoft VBScript compilation error '800a0400'
Expected statement
/www/contact/contactinclude.inc, line 3
Option Explicit
^
and this is my code:
<html>
<head>
<title>Welcome to Pinefield Manor</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../css/menustyle.css" type="text/css">
<link rel="stylesheet" href="../css/bodytext.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0">
<tr>
<td><!--#include file="../includes/header.inc"-->
<tr>
<td>
<table width="760" border="0" cellspacing="0" cellpadding="0"
align="center">
<tr>
<td width="72" valign="top" bgcolor="D4D4D4">
<!--#include file="../includes/menu.inc"--></td>
<td width="688" valign="top">
<p class="maintext"><b><!--#include
file="../contact/contactinclude.inc"--></p></b>
</td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0"
background="../home/images/bg_line.gif" align="center">
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</body>
</html>
and this is the form code:
<% @LANGUAGE= VBScript %>
<%
Option Explicit
Response.Expires = 0
Dim objConn, sDBConn, strQuery, objRS, benquiry
Dim strEnquiry, strEmail, strName, strFax, strHome
Dim mail, reply, objMail, strTitle
Dim strAddress, strPostcode, strMobile, strWork, strBrochure, strWebsite
Dim sCDO
' Now lets mail the form
If Request.Form.Count > 0 Then
strTitle = request.Form("title")
strName = request.form("Name")
strAddress = request.form("address")
strPostcode = request.Form("postcode")
strHome = request.form("home")
strMobile = request.form("mobile")
strWork = request.form("work")
strEmail = request.form("Email")
strBrochure = request.form("brochure")
strWebsite = request.form("website")
strEnquiry = request.form("enquiry")
Set sCDO = Server.CreateObject("CDONTS.NewMail")
strEmail = Request.Form("email")
strName = Request.Form("name")
sCDO.To = "lou@fifthring.co.uk"
sCDO.From = strEmail
sCDO.Subject = "Pinefield Manor Enquiry"
sCDO.BodyFormat = 0
sCDO.MailFormat = 0
sCDO.Body = "<HTML><BODY leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0' >" &_
"<table width='100%' border='0' cellspacing='0'
cellpadding='0'>" &_
"<tr>" &_
"<td
background='http://www.pinefield.co.uk/images/email_bg.gif'><a
href='http://www.pinefield.co.uk/'><img
src='http://www.pinefield.co.uk/images/email_header.gif' width='760'
height='89' border='0' alt='Pinefield Manor'></a></td>" &_
"</tr>" &_
"</table>" &_
"<table width='90%' border='0' cellspacing='0' cellpadding='12'>"
&_
"<tr><td><font face='Verdana'>" &_
"Name: " & strTitle & " " & strName & "<br><br>" & _
"Address: " & strAddress & "<br><br>" & _
"Postcode: " & strPostcode & "<br><br>" & _
"Home: " & strHome & "<br><br>" & _
"Mobile: " & strMobile & "<br><br>" & _
"Work: " & strWork & "<br><br>" & _
"Email: " & strEmail & "<br><br>" & _
"Please send me a brochure: " & strBrochure & "<br><br>" & _
"Website Feedback: " & strWebsite & "<br><br>" & _
"Enquiry: " & "<br><br>" & strEnquiry & "</font>" & _
"<br><br>---------------------------------------------------------" &_
"<p><font face='Verdana'>Scotia Homes Pinefield Manor</font><br>"
&_
"<font face='Verdana'>Tel: 0800 855 455</font><br>" &_
"<font face='Verdana'>Web: " & "<a
href='http://www.pinefield.co.uk/'>http://www.pinefield.co.uk</a></font></p>" &_
"</td></tr>" &_
"</table>" &_
"</BODY></HTML>"
sCDO.Send
Set sCDO = Nothing
benquiry = True
Else
benquiry = False
End If
%>
<LINK rel="stylesheet" type="text/css" href="pinefield_style.css">
<SCRIPT>
function formCheck()
{
if (document.theform.name.value == "")
{
alert("Please enter your name and re-submit.");
return false;
}
if (document.theform.address.value == "")
{
alert("Please enter your address and re-submit.");
return false;
}
if (document.theform.home.value == "")
{
alert("Please enter your home home number and re-submit.");
return false;
}
if (document.theform.email.value.indexOf("@") == -1 ||
document.theform.email.value == "")
{
alert("Please enter a valid email address and re-submit.");
return false;
}
return true;
}
</SCRIPT>
<link rel="stylesheet" href="../css/bodytext.css" type="text/css">
<form action="contact.asp" name="theform" method="POST" onSubmit="return
formCheck();">
<%If not benquiry Then%>
<br>
<table width="598" border="0" align="center" cellpadding="0" cellspacing="0"
class="bodyText">
<tr>
<td width="185" valign="top"> </td>
<td width="14" valign="top"> </td>
<td width="220" valign="top"><span class="bodyText">Mr</span>
<input type="radio" name="title" value="Mr">
Mrs
<input type="radio" name="title" value="Mrs">
Miss
<input type="radio" name="title" value="Miss">
Ms
<input type="radio" name="title"
value="Ms"></td>
<td width="16" rowspan="7" valign="top"> <div
align="center">
</div></td>
<td width="165" rowspan="7" valign="top"> </td>
</tr>
<tr>
<td width="185" height="15" valign="top"><img
src="images/spacer.gif" alt="" width="1" height="15"></td>
<td height="15" valign="top"> </td>
<td height="15" valign="top"> </td>
</tr>
<tr>
<td width="185" valign="top"><div
align="right">name*</div></td>
<td width="14" valign="top"> </td>
<td valign="top"><input type="text" name="name"
size="40" tabindex="1" class="form"></td>
</tr>
<tr>
<td width="185" height="15" valign="top"><img
src="images/spacer.gif" alt="" width="1" height="15"></td>
<td height="15" valign="top"> </td>
<td height="15" valign="top"> </td>
</tr>
<tr>
<td width="185" valign="top"><div
align="right">address*</div></td>
<td width="14" valign="top"> </td>
<td valign="top"><textarea name="address"
cols="40" rows="4" class="form" tabindex="1"></textarea></td>
</tr>
<tr>
<td width="185" height="15" valign="top"><img
src="images/spacer.gif" alt="" width="1" height="15"></td>
<td height="15" valign="top"> </td>
<td height="15" valign="top"> </td>
</tr>
<tr>
<td width="185" valign="top"><div
align="right"></div></td>
<td width="14" valign="top"> </td>
<td valign="top"><div align="right">postcode
<input type="text" name="postcode" size="8"
tabindex="1" class="form">
</div></td>
</tr>
<tr>
<td valign="top"><div align="right"></div></td>
<td width="14" valign="top"> </td>
<td colspan="3" valign="top"> </td>
</tr>
</table>
<table width="598" border="0" align="center" cellpadding="0" cellspacing="0"
class="bodyText">
<tr>
<td width="163">
<div align="right">
<p><strong>telephone</strong></p>
</div>
</td>
<td width="12"> </td>
<td width="129"> </td>
<td width="32"> </td>
<td width="52"> </td>
<td width="24"> </td>
<td width="188"> </td>
</tr>
<tr>
<td>
<div align="right"></div>
</td>
<td width="12"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<div align="right">home*</div>
</td>
<td width="12"> </td>
<td>
|