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 10 of 10
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Contact Form Help

    Hi there,
    Hopefully Ive posted this in the right place. I believe it's a php code.

    When I was younger I worked with HTML and a little bit of CSS, and I believe I have a fair understanding of coding, just no idea on php!

    My father runs an Amusement Ride business and obviously has a website.

    The old site he had in around 2009, wasn't that appealing, and was made by a friend of his.

    I come home recently to find he had updated his website, but again got sucked in (like usual) to the first option.

    The new site is a little more appealing and modern, however the contact form (he says) doesn't work.

    The old site while not appealing had a good contact form that he was happy with, the problem is we can't find the coding for it.

    What I did find was an email he had recieved from the old form and a bit of description on it;

    Code:
    An enquiry has been submitted from lina
    
    Their email address is *****@******.com and their phone number is
    *******
    
    Rides enquired about:
    
    Sizzler
    Giant Slides
    Chair-O-Plane
    Air/Jumping Castles
    Mini Ferris Wheel
    Bungy Run
    From what I can tell (which I assume you can) is that the form had textboxes linking to the name, email and number, and the the "rides enquired about:" was checkboxes. From what dad says, it was a pop up form (which I imagine would be easy to implement to the current code)


    If you need any more help or the current code, etc. Let me know!

  • #2
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    Look at the source for the form. It should indicate what page/script processes the form data . Also post the index page here and that also will help narrow down things

  • #3
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,377
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    Give us a link to the "new" website so we can see the contact page. For now just the link to the site, but maybe we'll need to see some more PHP scripting later.

  • #4
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #5
    Master Coder mlseim's Avatar
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,377
    Thanks
    8
    Thanked 1,075 Times in 1,066 Posts
    That lets us see the form ... which we needed to see.
    Now, post this script:
    http://www.amusementrides.net.au/php/barramusement.php

  • #6
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP of new contact form

    PHP Code:
    <?php

    $EmailFrom 
    "noreply@amusementrides.net.au";
    $EmailTo "daryl@amusementrides.net.au";
    $Subject "Hi Daryl, Enquiry made from amusementrides.net.au";
    $Name Trim(stripslashes($_POST['Name'])); 
    $Sub Trim(stripslashes($_POST['Subject'])); 
    $Email Trim(stripslashes($_POST['Email'])); 
    $Message Trim(stripslashes($_POST['Message'])); 

    // validation 
    $validationOK=true;
    if (!
    $validationOK) {
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
      exit;
    }

    // prepare email body text
    $Body "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "\n";
    $Body .= "Subject: ";
    $Body .= $Sub;
    $Body .= "\n";
    $Body .= "Email: ";
    $Body .= $Email;
    $Body .= "\n";
    $Body .= "Message: ";
    $Body .= $Message;
    $Body .= "\n";

    // send email 
    $success mail($EmailTo$Subject$Body"From: <$EmailFrom>");

    // redirect to success page 
    if ($success){
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=/contacts.html\">";
    }
    else{
      print 
    "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
    }
    ?>

  • #7
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Does he receive an email which is missing some or all of the form information, or does the email never get sent?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #8
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not 100% sure.
    From what I can gather. The new one works, but he believes he gets less inquiries for the simple fact people have to write more.

    On the old one all the had to do was fill out their basic info and then the contact form in a way became interactive as they could tick boxes on rides/attractions that interested them.

    However with the new one they'd have to write out all their information on the event/rides/etc.

  • #9
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    U think he also liked the fact that in the old one, the email came from the one they put in. So all he had to do was hit reply, rather than extract it from the email body. (If that makes sense)

  • #10
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Here is a link to an explanation of HTML forms which will help you fix the checkboxes thing:
    http://www.w3schools.com/html/html_forms.asp

    If you change this line

    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");


    to

    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: <$Email>");


    He should be able to reply directly

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Tags for this Thread

    Posting Permissions

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