• 0

[ASP] Contact form not working


Question

Hello neowin!

I need your help and it is urgent I know nothing of .ASP or .PHP but I already attached a number of PHP contact forms, but with .asp..........

I don't know why my form won't work it is from

http://www.tele-pro.co.uk/scripts/contact_form/

whenever I press submit/send it will simply show up as text instead of e-mailing me and redirecting me to the thankyou page.

Can anyone please help me out.

Link to comment
https://www.neowin.net/forum/topic/735460-asp-contact-form-not-working/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

i uploaded it the .asp file but it seem it won't work.

<%
' Website Contact Form Generator 
' http://www.tele-pro.co.uk/scripts/contact_form/ 
' This script is free to use as long as you  
' retain the credit link  

' declare variables
Dim Name1
Dim Dbr
Dim Tbr
Dim Pbr
Dim Address
Dim contcode
Dim areacode
Dim Telno
Dim Fexno
Dim EmailFrom
Dim EmailTo
Dim Country
'Dim Desc
Dim Remarks

' get posted data into variables

Name1 = Trim(Request.Form("Name1Dbr = Trim(Request.Form("DbrTbr = Trim(Request.Form("TbrPbr = Trim(Request.Form("Pbrcontcode = Trim(Request.Form("contcodeareacode = Trim(Request.Form("areacodeTelno = Trim(Request.Form("TelnoFexno = Trim(Request.Form("FexnoAddress = Trim(Request.Form("AddressEmailFrom = Trim(Request.Form("EmailCountry = Trim(Request.Form("CountryDesc = Trim(Request.Form("Descemarks = Trim(Request.Form("Remarks
' validation
'Dim validationOK
'validationOK=true
'If (Trim(EmailFrom)="") Then validationOK=false
'If (Trim(Name1)="") Then validationOK=false
'If (Trim(Company)="") Then validationOK=false
'If (Trim(Address)="") Then validationOK=false
'If (Trim(City)="") Then validationOK=false
'If (Trim(PostCode)="") Then validationOK=false
'If (Trim(Country)="") Then validationOK=false
'If (Trim(Tel)="") Then validationOK=false
'If (Trim(Fax)="") Then validationOK=false
'If (Trim(Website)="") Then validationOK=false
'If (Trim(Importers)="") Then validationOK=false
'If (Trim(ChainofStores)="") Then validationOK=false
'If (Trim(Distributors)="") Then validationOK=false
'If (Trim(Retailers)="") Then validationOK=false
'If (Trim(Wholesales)="") Then validationOK=false
'If (Trim(ByAirFreight)="") Then validationOK=false
'If (Trim(MostEconomicalMode)="") Then validationOK=false
'If (Trim(BySeaFreight)="") Then validationOK=false
'If (Trim(Others)="") Then validationOK=false
'If (Trim(ByAirPostParcel)="") Then validationOK=false
'If (Trim(Airport_SeaPortofDestination)="") Then validationOK=false
'If Not (IsNumeric(Airport_SeaPortofDestination)) Then validationOK=false
'If (Trim(CIFDestinationRates)="") Then validationOK=false
'If Not (IsNumeric(CIFDestinationRates)) Then validationOK=false
'If (Trim(FOBMumbaiRates)="") Then validationOK=false
'If (Trim(BriefDescriptionaboutyou_YourBusiness)="") Then validationOK=false
'If Not (IsNumeric(BriefDescriptionaboutyou_YourBusiness)) Then validationOK=false
'If (Trim(YourComments_Remarks)="") Then validationOK=false
'If Not (IsNumeric(YourComments_Remarks)) Then validationOK=false
'If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

' prepare email body text
Dim Body
Body = Body & "Name: " & Name1 & VbCrLf
Body = Body & "Email: " & EmailFrom & VbCrLf
Body = Body & "Country Code: " & contcode & VbCrLf
Body = Body & "Area Code: " & areacode & VbCrLf
Body = Body & "Telno: " & Telno & VbCrLf
Body = Body & "FAXno: " & Telno & VbCrLf
Body = Body & "Organization/ Company: " & Pbr & VbCrLf
Body = Body & "City/State: " & Tbr & VbCrLf
Body = Body & "Zip/Postal Code:  : " & Dbr & VbCrLf
Body = Body & "Address: " & Address & VbCrLf
Body = Body & "Country: " & Country & VbCrLf
' Body = Body & "Description: " & Desc & VbCrLf
Body = Body & "Please Describe Your Requirements: " & Remarks & VbCrLf

Set myMail=CreateObject("CDO.Message")
myMail.Subject="FEEDBACK"
myMail.From=EmailFrom
myMail.To="Email" 
myMail.TextBody=Body
myMail.Send
set myMail=nothing

 'Response.Write("Informationbeen sent successfully")
' redirect to success page 
Response.Redirect("ok1.htm?" & EmailFrom)
%>

here's the code for it. everything is working fine until i took down the site and reuploaded the whole thing.

  • 0

Well, for one thing it is missing the html part of the code.

Even with the html in there it would take you straight to "error.htm?" because it tries to validate the fields without waiting for or checking to see if the form was submitted. It validates all the empty/missing fields as false and takes you straight to that page.

If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

But it should work after you add the html for now since you commented out that piece of code.

Put the html code outside of the

<% %>

tags

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.