Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: web contact form help

  
  1. #1
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)

    web contact form help

    hi computer folk, please can you help

    i wanted to add a simple contact/comments form to my website.

    i found this site http://www.tele-pro.co.uk/scripts/contact_form/

    which gives me the html code and a script file

    i added the html code to my page, and saved the script file using notepad

    published it,

    however, when you click submit on my form the browser just gives an error 404 as it trys to 'view' the script page contact.asp or contact.php

    i'm obviously doing something wrong but i dont know what??

  2. #2
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Who's your webhost and do they support PHP/ASP?

    Have you configured the script to pipe data to the correct binary on the server to send the mail?

  3. #3
    Status
    Offline
    Phil B's Avatar
    AkA P_Man
    Join Date
    Nov 2005
    Posts
    1,971
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Quote Originally Posted by domino View Post
    Have you configured the script to pipe data to the correct binary on the server to send the mail?
    What? lol.

    A 404 means the page isnt found, regardless of anything else you've done. You need to a) double check the form targets 'contact.php'. Then b) make sure you placed the php code in 'contact.php' and the two files sit on the server in the same place. There cant really be anything else wrong at this stage due to the 404.

    Whether or not your server supports php (or asp) will become clear when you get past the 404. Most cheapie shared hosting packages will support php though, but will unlikely offer any mysql databases without extra cost.

  4. #4
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    arrr could be that, it is as if it refuses to recognise the script file.
    the webhost is plusnet and I havnent checked so i'll find out.

    the script is apparently self sufficient ??

    <%
    ' 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 EmailFrom
    Dim EmailTo
    Dim Subject
    Dim Name
    Dim Address
    Dim Telephone

    ' get posted data into variables
    EmailFrom = "feedback@mywebsite.co.uk"
    EmailTo = "myemail@yahoo.com"
    Subject = "Website Feedback"
    Name = Trim(Request.Form("Name"))
    Address = Trim(Request.Form("Address"))
    Telephone = Trim(Request.Form("Telephone"))

    ' validation
    Dim validationOK
    validationOK=true
    If (Trim(Name)="") Then validationOK=false
    If (validationOK=false) Then Response.Redirect("error.htm?" & EmailFrom)

    ' prepare email body text
    Dim Body
    Body = Body & "Name: " & Name & VbCrLf
    Body = Body & "Address: " & Address & VbCrLf
    Body = Body & "Telephone: " & Telephone & VbCrLf

    ' send email
    Dim mail
    Set mail = Server.CreateObject("CDONTS.NewMail")
    mail.To = EmailTo
    mail.From = EmailFrom
    mail.Subject = Subject
    mail.Body = Body
    mail.Send

    ' redirect to success page
    Response.Redirect("ok.htm?" & EmailFrom)
    %>


    it uses the CDONTS. I think the only changes i need to make are the ok and errror htm addresses

  5. #5
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    i copy and pasted the script into notepad, and saved it as a php

    then i uploaded it to the server in the same directory as the html

    the html tells it to go to the script

    when you fill in the form and click submit - the browser goes to it but just shows the contact.php in the address bar, but says 404

  6. #6
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    here is the html

    <!-- astrasport

    <!-- 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 -->

    <form method="POST" action="contact.asp">
    Fields marked (*) are required

    <p>Name:* <br>
    <input type="text" name="Name">
    <p>Address:<br>
    <input type="text" name="Address">
    <p>Telephone:<br>
    <input type="text" name="Telephone">
    <p><input type="submit" name="submit" value="Submit">
    </form>
    <p>

    <!-- Contact Form credit link -->
    Created by <a target="_blank"
    href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact
    Form Generator</a>

    astrasport -->

  7. #7
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)

  8. #8
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    The fact that's it's ASP is a problem straight off.

    Phil: That's exactly my point. If you're pointing to a contact.asp and you're running on a PHP system you'll get a 404 (because most coders and developers will use a .php extension for php and .asp for ASP)
    We could however go on for ages. If the coding is wrong and you point it to "contact.php" instead of "Contact.php" and the file on the server is "Contact.php" you'll get a 404.
    ....doesn't really happen on a Windows server because they're generally not configured to be case sensitive.... and again, you'll most likely find ASP running on a Windows server, not LAMP.

  9. #9
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    You can't rename a file to ".php" and expect it to be parsed as PHP. It's written in ASP so needs ASP support to run

  10. #10
    Status
    Offline
    Cash's Avatar
    AOC Fanatic
    Join Date
    May 2003
    Posts
    369
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    i've activated mySQL and CGI...

    ...whatever they are. I do not think that's instant though.

    still 404 at the moment

Page 1 of 3 123 LastLast

Similar Threads

  1. Anyone with NRJ's contact details can you contact me...
    By SimonP in forum Chit Chat and a Warm Welcome!
    Replies: 8
    Last Post: 14-10-2004, 20:52

Posting Permissions

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