I'll post the whole page of code, because I am unsure at what is what really apart from the common knowledge stuff i.e. the send email to etc, but this wasn't designed by me so I am unsure if it's wrong or right..
If someone could let me know whether there's a problem with the code or if the problem may lay elsewhere that'd be really handy.
Thanks alot!
Expand|Select|Wrap|Line Numbers
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
- <!--#include file="i-functions.asp" -->
- <%
- sPageName = "order"
- sPageTitle = "Order Form"
- %>
- <%
- If Request("Validate") = "Y" then
- nCounter = 0
- sItemsOrdered = Request("item")
- sOrderArray = Split(sItemsOrdered, ",")
- for i = 0 to UBound(sOrderArray)
- nCounter = nCounter + 1
- next
- sFirstName = Request("FirstName")
- If not containsValue(sFirstName) then
- Call AddError(sErrorString, "FirstName|")
- End If
- Session("BuyerFirstName") = sFirstName
- sLastName = Request("LastName")
- If not containsValue(sLastName) then
- Call AddError(sErrorString, "LastName|")
- End If
- Session("BuyerLastName") = sLastName
- sTelephone = Request("Telephone")
- If not containsValue(sTelephone) then
- Call AddError(sErrorString, "Telephone|")
- End If
- Session("BuyerTelephone") = sTelephone
- sMobile = Request("Mobile")
- sEmail = Request("Email")
- if not ContainsValue(sEmail) then
- Call AddError(sErrorString, "Email|")
- elseif (InStr(sEmail, "@") = 0) or (InStr(sEmail, ".") = 0) then
- Call AddError(sErrorString, "Email|")
- End If
- Session("BuyerEmail") = sEmail
- 'sInvAddress1 = Request("InvAddress1")
- 'If not containsValue(sInvAddress1) then
- ' Call AddError(sErrorString, "InvAddress1|")
- 'End If
- 'Session("BuyerInvAddress1") = sInvAddress1
- 'sInvAddress2 = Request("InvAddress2")
- 'Session("BuyerInvAddress2") = sInvAddress2
- 'sInvTown = Request("InvTown")
- 'If not containsValue(sInvTown) then
- ' Call AddError(sErrorString, "InvTown|")
- 'End If
- 'Session("BuyerInvTown") = sInvTown
- 'sInvCounty = Request("InvCounty")
- 'If not containsValue(sInvCounty) then
- ' Call AddError(sErrorString, "InvCounty|")
- 'End If
- 'Session("BuyerInvCounty") = sInvCounty
- 'sInvPostcode = Request("InvPostcode")
- 'If not containsValue(sInvPostcode) then
- ' Call AddError(sErrorString, "InvPostcode|")
- 'End If
- 'Session("BuyerInvPostcode") = sInvPostcode
- sDelAddress1 = Request("DelAddress1")
- If not containsValue(sDelAddress1) then
- Call AddError(sErrorString, "DelAddress1|")
- End If
- sDelAddress2 = Request("DelAddress2")
- sDelTown = Request("DelTown")
- If not containsValue(sDelTown) then
- Call AddError(sErrorString, "DelTown|")
- End If
- sDelCounty = Request("DelCounty")
- If not containsValue(sDelCounty) then
- Call AddError(sErrorString, "DelCounty|")
- End If
- sDelPostcode = Request("DelPostcode")
- If not containsValue(sDelPostcode) then
- Call AddError(sErrorString, "DelPostcode|")
- End If
- sHeardaboutOther= Request("HeardaboutOther")
- sHeardabout = Request("Heardabout")
- If sHeardabout = "X" then
- Call AddError(sErrorString, "Heardabout|")
- End If
- If ((sHeardabout = "Internet Search") and not containsValue(sHeardaboutOther)) then
- Call AddError(sErrorString, "HeardaboutOther|")
- End If
- If ((sHeardabout = "Friend") and not containsValue(sHeardaboutOther)) then
- Call AddError(sErrorString, "HeardaboutOther|")
- End If
- sRegDate = MySQLFriendlyDate(Date()) & " " & Time()
- if not containsValue(sErrorString) then
- sMessage = sMessage & "<html><body><table>"
- sMessage = sMessage & "<tr><td colspan=""2"">The following order details were submitted from the website. </td></tr>"
- sMessage = sMessage & "<tr><td> </td><td> </td></tr>"
- sMessage = sMessage & "<tr><td colspan=""2""><b>Contact Details</b></td></tr>"
- sMessage = sMessage & "<tr><td>Name:</td><td>" & sFirstName & " " & sLastName & "</td></tr>"
- sMessage = sMessage & "<tr><td>Telephone:</td><td>" & sTelephone & "</td></tr>"
- sMessage = sMessage & "<tr><td>Mobile:</td><td>" & sMobile & "</td></tr>"
- sMessage = sMessage & "<tr><td>Email:</td><td>" & sEmail & "</td></tr>"
- sMessage = sMessage & "<tr><td> </td><td> </td></tr>"
- 'sMessage = sMessage & "<tr><td colspan=""2""><b>Invoice Address</b></td></tr>"
- 'sMessage = sMessage & "<tr><td>Address:</td><td>" & sInvAddress1 & "</td></tr>"
- 'If containsValue(sInvAddress2) then
- ' sMessage = sMessage & "<tr><td> </td><td>" & sInvAddress2 & "</td></tr>"
- 'End if
- 'sMessage = sMessage & "<tr><td>Town:</td><td>" & sInvTown & "</td></tr>"
- 'sMessage = sMessage & "<tr><td>County:</td><td>" & sInvCounty & "</td></tr>"
- 'sMessage = sMessage & "<tr><td>Postcode:</td><td>" & sInvPostcode & "</td></tr>"
- 'sMessage = sMessage & "<tr><td> </td><td> </td></tr>"
- sMessage = sMessage & "<tr><td colspan=""2""><b>Delivery Address</b></td></tr>"
- sMessage = sMessage & "<tr><td>Address:</td><td>" & sDelAddress1 & "</td></tr>"
- If containsValue(sDelAddress2) then
- sMessage = sMessage & "<tr><td> </td><td>" & sDelAddress2 & "</td></tr>"
- End if
- sMessage = sMessage & "<tr><td>Town:</td><td>" & sDelTown & "</td></tr>"
- sMessage = sMessage & "<tr><td>County:</td><td>" & sDelCounty & "</td></tr>"
- sMessage = sMessage & "<tr><td>Postcode:</td><td>" & sDelPostcode & "</td></tr>"
- sMessage = sMessage & "<tr><td> </td><td> </td></tr>"
- sMessage = sMessage & "<tr><td>Heard about us?</td><td>" & sHeardabout & "</td></tr>"
- If containsValue(sHeardaboutOther) then
- sMessage = sMessage & "<tr><td> </td><td>" & sHeardaboutOther & "</td></tr>"
- End if
- sMessage = sMessage & "<tr><td> </td><td> </td></tr>"
- sMessage = sMessage & "<tr><td colspan=""2""><b>Items Ordered</b></td></tr>"
- sMessage = sMessage & "<tr><td colspan=""2"">" & Request("item") & "</td></tr>"
- sMessage = sMessage & "</table></body></html>"
- Set objNewMail = Server.CreateObject("CDO.Message")
- objNewMail.Subject = "Website Order Form"
- objNewMail.From = "info@happy-meat.co.uk"
- objNewMail.To = "sales@local-meat.co.uk"
- 'objNewMail.To = "frank@designinc.co.uk"
- 'objNewMail.To = "jonathan@futuraweb.co.uk"
- objNewMail.HTMLBody = sMessage
- 'objMail.BodyFormat = 0
- objNewMail.Send
- set objNewMail=nothing
- 'confirmation email to the customer
- sMessage1 = sMessage1 & "Thank you for placing an order through the Really Well Bred Meat Company website.<br> We are currently processing your order and will be contacting you soon to arrange payment and delivery.<br><br>Thanks again,<br>Sammy<br>The Really Well Bred Meat Company"
- Set objNewMail1 = Server.CreateObject("CDO.Message")
- objNewMail1.Subject = "Website Order Form"
- objNewMail1.From = "info@local-meat.co.uk"
- objNewMail1.To = sEmail
- 'objNewMail.To = "frank@designinc.co.uk"
- objNewMail1.HTMLBody = sMessage1
- 'objMail.BodyFormat = 0
- objNewMail1.Send
- set objNewMail1=nothing
- Response.redirect "ordered.asp"
- Else
- End if
- End if
- %>
- <!--#include file="i-header.asp" -->
- <div id="content">
- <div class="minheight"></div>
- <div class="fullcontent">
- <form name="order" method="POST" action="">
- <input type="hidden" name="Validate" value="Y" />
- <div class="fullleft">
- <h1><%= sPageTitle %></h1>
- <% if containsValue(sErrorString) then %>
- <p><span style="color:#FF0000;font-weight:bold;">There are errors. Please complete the fields highlighted in red.</span></p>
- <% Else %>
- <% End If %>
- <h3>Ways to Pay</h3>
- <p>If you would like to place an order, please choose from one of the following options.</p>
- <h4>Order Online</h4>
- <p>Complete and submit the order form on this page.</p>
- <h4>Order over the Phone</h4>
- <p>Place an order over the phone by calling <span style="font-weight: bold"> 023 9247 9801</span> or 07834 998 048</p>
- <h4>Order by Post</h4>
- <p>Alternatively fill out the order form, print it off and post it to us along with a cheque made payable to The Really Well Bred Meat Co Ltd. Please post your order form to
- The Really Well Bred Meat Co, 40 Acre Farm, Havant Road, Bedhampton, Hants. PO9 3LW. </p>
- <div class="yellowpanel">
- <p>To place an order, please type in your requirements below</p>
- <div align="center">
- <p>
- <textarea name="item" cols="30" rows="6"></textarea>
- </p>
- <p><br />
- </p>
- </div>
- <div class="clear"></div>
- </div>
- </div>
- <div class="fullright">
- <fieldset>
- <h3>Your Details</h3>
- <div class="formrow">
- <label for="FirstName"><% if InStr(sErrorString, "FirstName|") > 0 then %><span style="color:#FF0000;">First name *</span><% Else %>First name *<% End if %></label> <input name="FirstName" type="text" class="text" value="<%= sFirstName %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="LastName"><% if InStr(sErrorString, "LastName|") > 0 then %><span style="color:#FF0000;">Last name *</span><% Else %>Last name *<% End if %></label> <input name="LastName" type="text" class="text" value="<%= sLastName %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="Telephone"><% if InStr(sErrorString, "Telephone|") > 0 then %><span style="color:#FF0000;">Telephone number *</span><% Else %>Telephone number *<% End if %></label> <input name="Telephone" type="text" class="text" value="<%= sTelephone %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="Mobile">Mobile number</label> <input name="Mobile" type="text" class="text" value="<%= sMobile %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="Email"><% if InStr(sErrorString, "Email|") > 0 then %><span style="color:#FF0000;">Email address *</span><% Else %>Email address *<% End if %></label> <input name="Email" type="text" class="text" value="<%= sEmail %>" />
- <div class="clear"></div>
- </div>
- </fieldset>
- <fieldset>
- <h3>Delivery Address</h3>
- <div class="formrow">
- <label for="DelAddress1"><% if InStr(sErrorString, "DelAddress1|") > 0 then %><span style="color:#FF0000;">Address *</span><% Else %>Address *<% End if %></label> <input name="DelAddress1" type="text" class="text" value="<%= sDelAddress1 %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="DelAddress2"> </label> <input name="DelAddress2" type="text" class="text" value="<%= sDelAddress2 %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="DelTown"><% if InStr(sErrorString, "DelTown|") > 0 then %><span style="color:#FF0000;">Town *</span><% Else %>Town *<% End if %></label> <input name="DelTown" type="text" class="text" value="<%= sDelTown %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="DelCounty">County</label> <select name="DelCounty" class="text">
- <option value="Hampshire" <% if sDelCounty = "Hampshire" then response.write "selected" %>>Hampshire</option>
- <option value="West Sussex" <% if sDelCounty = "West Sussex" then response.write "selected" %>>West Sussex</option>
- </select>
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="DelPostcode"><% if InStr(sErrorString, "DelPostcode|") > 0 then %><span style="color:#FF0000;">Postcode *</span><% Else %>Postcode *<% End if %></label> <input name="DelPostcode" type="text" class="text" value="<%= sDelPostcode %>" />
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="Heardabout"><% if InStr(sErrorString, "Heardabout|") > 0 then %><span style="color:#FF0000;">Where did you hear about us? *</span><% Else %>Where did you hear about us? *<% End if %></label>
- <select name="Heardabout" id="Heardabout">
- <option value="X">Please select</option>
- <option value="Internet Search" <% if sHeardabout = "Internet Search" then response.write "selected" %>>Internet Search</option>
- <option value="HTML Email" <% if sHeardabout = "HTML Email" then response.write "selected" %>>HTML Email</option>
- <option value="Friend" <% if sHeardabout = "Friend" then response.write "selected" %>>Friend</option>
- <option value="Existing Customer" <% if sHeardabout = "Existing Customer" then response.write "selected" %>>Existing Customer</option>
- <option value="Advert in Trade Magazine" <% if sHeardabout = "Advert in Trade Magazine" then response.write "selected" %>>Advert in Trade Magazine</option>
- <option value="Advert in Newspaper" <% if sHeardabout = "Advert in Newspaper" then response.write "selected" %>>Advert in Newspaper</option>
- <option value="Flyer" <% if sHeardabout = "Flyer" then response.write "selected" %>>Flyer</option>
- <option value="Van Livery" <% if sHeardabout = "Van Livery" then response.write "selected" %>>Van Livery</option>
- </select>
- <div class="clear"></div>
- </div>
- <div class="formrow">
- <label for="HeardaboutOther"><% if InStr(sErrorString, "HeardaboutOther|") > 0 then %><span style="color:#FF0000;">Which search engine / name of friend:</span><% Else %>Which search engine / name of friend:<% End if %></label> <input name="HeardaboutOther" type="text" class="text" value="<%= sHeardaboutOther %>" />
- <div class="clear"></div>
- </div>
- </fieldset>
- <p><input type="image" src="images/btn-order.gif" alt="Make payments with PayPal - it's fast, free and secure!" /></p>
- </div>
- <div class="clear"></div>
- <p style="text-align:center;color:#006892;font-size:120%;font-weight:bold;">Alternatively place your order by calling <span style="font-weight: bold"> 023 9247 9801</span> or <span style="font-weight: bold">07834 998 048</span></p>
- </form>
- </div>
- <div class="clear"></div>
- </div>
- <!--#include file="i-footer.asp" -->