dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: asp includes

Hybrid View

  1. #1
    fk's official minger
    Join Date
    Oct 2000
    Location
    scotland
    Posts
    269

    asp includes

    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"--></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'></td>" &_
    "</tr>" &_
    "</table>" &_
    "<table width='90%' border='0' cellspacing='0' cellpadding='12'>" &_
    "<tr><td><font face='Verdana'>" &_
    "Name: " & strTitle & " " & strName & "

    " & _
    "Address: " & strAddress & "

    " & _
    "Postcode: " & strPostcode & "

    " & _
    "Home: " & strHome & "

    " & _
    "Mobile: " & strMobile & "

    " & _
    "Work: " & strWork & "

    " & _
    "Email: " & strEmail & "

    " & _
    "Please send me a brochure: " & strBrochure & "

    " & _
    "Website Feedback: " & strWebsite & "

    " & _
    "Enquiry: " & "

    " & strEnquiry & "</font>" & _
    "

    ---------------------------------------------------------" &_
    "<font face='Verdana'>Scotia Homes Pinefield Manor</font>
    " &_
    "<font face='Verdana'>Tel: 0800 855 455</font>
    " &_
    "<font face='Verdana'>Web: " & "</font>" &_
    "</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%>




    <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">
    telephone
    </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>
    <input type="text" name="home" size="20" tabindex="14" class="form">
    </td>
    <td> </td>
    <td>mobile </td>
    <td> </td>
    <td>
    <input type="text" name="mobile" size="20" tabindex="14" class="form">
    </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">work</div>
    </td>
    <td width="12"> </td>
    <td>
    <input type="text" name="work" size="20" tabindex="15" class="form">
    </td>
    <td> </td>
    <td>email*</td>
    <td> </td>
    <td>
    <input type="text" name="email" size="20" tabindex="14" class="form">
    </td>
    </tr>
    <tr>
    <td> </td>
    <td width="12"> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td valign="top">
    <div align="right">ask us a question::</div>
    </td>
    <td width="12"> </td>
    <td colspan="5">
    <textarea name="enquiry" cols="65" rows="6" class="form" tabindex="1"></textarea>
    </td>
    </tr>
    <tr>
    <td height="24" valign="top"><img src="images/spacer.gif" alt="" width="1" height="15"></td>
    <td width="12" height="24"> </td>
    <td height="24" colspan="5"><img src="images/spacer.gif" alt="" width="1" height="15"></td>
    </tr>
    <tr>
    <td valign="top" height="69">
    <div align="right">how can we improve our website?:</div>
    </td>
    <td width="12" height="23" rowspan="2"> </td>
    <td colspan="5" height="23" rowspan="2">

    <textarea name="website" cols="65" rows="6" class="form" tabindex="1"></textarea>

    <p align="left"> please send me a brochure
    <input type="checkbox" name="brochure" value="Yes">

    </td>
    </tr>
    <tr>
    <td valign="top" height="12"> </td>
    </tr>
    <tr>
    <td valign="top"> </td>
    <td width="12"> </td>
    <td colspan="5">
    <div align="right">
    <input type="image" src="images/submit.gif" name="Submit" value="Submit" border="0" alt="Submit">
    </div>
    </td>
    </tr>
    </table>
    </form>
    <%else%>
    <p class="maintext"><b><span class="bodyText">Thank you for your enquiry. </span></b>
    <span class="bodyText">If you require any assistance, please do not hesitate
    to contact us, via e-mail to info@scotia-homes.co.uk
    </span>

























    <%end if%>




    any help much appreciated,

    louise
    meep meep

  2. #2
    .NET addict
    Join Date
    Sep 2000
    Location
    St Albans, UK
    Posts
    12
    Your problem is that includes shouldnt have any <% @Language... and shouldnt have the Option Explicit line... basically an ASP include should be like

    Code:
    <%
    ' Your code here
    %>
    C#ley?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center