Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Request.form not getting data from online form

    I hope someone would be able to help me before I pull all my hair out.

    I have a simple HTML form on my website.I`m posting this form via CDOSDYS to an email address.The problem is that none of the user input is sent i.e the email arrives with the following:
    Name:
    Telephone:
    Email:
    Country:
    enquiry:
    time:


    My Form data is:

    <form name="enquiry" id="enquiry" method="post" action="cdosys.asp" enctype="text/plain">
    <p class="level1_headings">Please use this feedback form to leave your comments.</P>
    <p class="bodytext">
    Your name: <br>
    <input type="text" name="name" size="35"><br>
    Telephone:<br>
    <input type="text" name="telephone" size="35">
    <br>
    Your e-mail address:<br>
    <input type="text" name="email" size="35">
    <br>
    Country:<br>
    <select name="Country" size="1">
    <option selected>South Africa</option>
    <option value=Rest of the world>Rest of the world</option>
    <p class="bodytext">
    Your Comments:<br>
    <textarea name="comments" rows="3" cols="50" wrap="physical"></textarea>
    <p class="bodytext">
    What time can we call you?<br>
    <input type="radio" name="time" value="morning"> 08.00-12.00hrs
    <input type="radio" name="time" value="afternoon"> 12.00-16.00hrs
    <input type="radio" name="time" value="evening">16.00 to 22.00hrs
    <br><br>
    <input type="submit" value="send">
    <input type="reset" value="reset">
    </form>

    My asp page is as follows:

    <%
    Const cdoSendUsingMethod ="http://schemas.microsoft.com/cdo/configuration/sendusing"
    Const cdoSMTPServer ="http://schemas.microsoft.com/cdo/configuration/smtpserver"
    Const cdoSMTPServerPort ="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
    Const cdoSMTPConnectionTimeout ="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
    Const cdoSMTPAuthenticate ="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"

    Dim objConfig
    Dim objMessage
    Dim Fields

    'Declare variables
    Dim name
    Dim telephone
    Dim email
    Dim country
    Dim enquiry
    Dim time

    name = Request.Form("name")
    Response.Write(name)
    telephone = Request.Form("telephone")
    Response.Write(telephone)
    email = Request.Form("email")
    Response.Write(email)
    country = Request.Form("country")
    Response.Write(country)
    enquiry = Request.Form("enquiry")
    Response.Write(enquiry)
    time = Request.Form("time")
    Response.Write(time)

    TextBody = "Name: "& name & vbcrlf
    TextBody = TextBody & "Telephone: "& telephone & vbcrlf
    TextBody = TextBody & "Email: "& email & vbcrlf
    TextBody = TextBody & "Country: "& country & vbcrlf
    TextBody = TextBody & "enquiry: "& enquiry & vbcrlf
    TextBody = TextBody & "time: "& time & vbcrlf


    Set objConfig = Server.CreateObject("CDO.Configuration")
    Set Fields = objConfig.Fields

    With Fields
    .Item(cdoSendUsingMethod) = 2
    .Item(cdoSMTPServer) = "localhost"
    .Item(cdoSMTPServerPort) = 25
    .Item(cdoSMTPConnectionTimeout) = 10
    .Update
    End With

    Set objMessage = Server.CreateObject("CDO.Message")
    Set objMessage.Configuration = objConfig



    With objMessage
    .To = "User <mutasatc@gmail.com>"
    .CC = "User <mutasatc@gmail.com>"
    .From = "User <mutasatc@gmail.com>"
    .Subject = "Lordsec Website Enquiry"
    .TextBody = TextBody
    .Send
    End With

    Set Fields = Nothing
    Set objMessage = Nothing
    Set objConfig = Nothing
    response.redirect("http://www.lordsec.co.za/thankyou.htm")
    %>
    Last edited by charmut; 01-08-2008 at 01:50 PM. Reason: Gramma

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Take enctype="text/plain" out of your form tag.

    ps. it's generally not a good idea to call form fields "name".

  • #3
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Spudhead View Post
    Take enctype="text/plain" out of your form tag.

    ps. it's generally not a good idea to call form fields "name".
    Thanks.I have taken enctype="text/plain" out of the form.I also renamed the field that I hitherto referred to as "name".Unfortunately the email sent is still missing the user input:
    Name:
    Telephone:
    Email:
    Country:
    enquiry:
    time:

  • #4
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up I fixed the thing

    works like a charm now!


  •  

    Posting Permissions

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