Grow your CSS skills. Land your dream job.

Contact Form from CSS Tricks wont work

  • # April 17, 2011 at 12:53 pm

    Hi everyone,

    I downloaded the contact form in the download section of this site.

    I put my own emails into it but changed nothing else.

    I uploaded to a test server – http://michaeloneilldesign.com/formtest

    It wont work!! I dont know why. Php is enabled on my server.

    here is the contactengine.php file… am I doing something wrong here ?

    < ?php

    // CHANGE THE VARIABLES BELOW

    $EmailFrom = "michael@michaeloneilldesign.com";
    $EmailTo = "michael@michaeloneilldesign.com";
    $Subject = "Contact Form Submission";

    $Name = Trim(stripslashes($_POST));
    $Tel = Trim(stripslashes($_POST));
    $Email = Trim(stripslashes($_POST));
    $Message = Trim(stripslashes($_POST));

    // prepare email body text
    $Body = "";
    $Body .= "Name: ";
    $Body .= $Name;
    $Body .= "n";
    $Body .= "Tel: ";
    $Body .= $Tel;
    $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
    // CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE
    if ($success){
    print "";
    }
    else{
    print "";
    }
    ?>

    Thanks for your help

    # April 17, 2011 at 3:06 pm

    Possibly because your form has an input named City, but its never mentioned in the contactengine.php file. Likewise the contactengine.php file is looking for a value from a input named Tel, but none exists in your form.

    # April 17, 2011 at 5:03 pm

    @DogsGhost
    I’ve had that issue before, but my form would still submit and redirect correctly, it would just give a blank value for the missing input name. So I’m thinking it might be something else.

    # April 17, 2011 at 5:35 pm

    @DogsGhost I have changed that but it still wont work! Any other ideas ?

    # April 17, 2011 at 5:38 pm

    Ive just tried it on a different server and it works perfectly. The link above is hosted with Godaddy… There must be something getting in the way on the hosting end! Anyone know anything about this ?

    # April 17, 2011 at 10:57 pm

    oh, godaddy hosting…. yep, you have to direct forms through one of their specified mailer php files located in the site’s root directory.

    # April 18, 2011 at 4:01 am

    I also had such problem, and frankly speaking i am not good at it, so I found a program that builds different kinds of forms. Now all my forms work great.

    # April 18, 2011 at 5:43 am

    DogsGhost could you elaborate on that a little? I’m having the same problem!

    # April 18, 2011 at 5:46 am

    @Fourize I got it working… In Godaddy in your control panel, go to form mail and put your email address in…. Then in your html file in the form tag put action=”gdform.php” Its a file preinstalled on your server!

    # April 18, 2011 at 6:31 am

    @michaeloneill I’ve just read that very article, but annoyingly I seem to have deleted this file in a ‘what on earth is this nonsense in my shiny new hosting package’ excitable mood.

    However it looks as though the webformmailer.php file is restorable so will try it with that.

    Thanks for the help!

    # April 18, 2011 at 7:02 am

    Huzaar! I didn’t even have to change the php file being used. Simply add the address manually using this tut http://community.godaddy.com/help/article/508?locale=en

    and it worked a charm, half the problem was godaddy didn’t update my mx records automatically so everything was being bounced back.

    # April 19, 2011 at 7:50 pm

    Total rookie hear and after reading this post i could still use some help please. I am using the Fast Secure Contact Form and I get the test message followed by a failure message. I have changed email from to the godaddy supplied address. I dont know if i found the specified mailer php files located in the site’s root directory. any suggestions would be greatly appreciated!

    Regards

    # April 20, 2011 at 6:38 am

    No problem Joe, did you create your own ‘key’ through the recaptcha site? also try the link above your post. I didn’t need to amend anything manually in the php files in the root directory. Also Godaddy didn’t update my mxrecords manually for email so have you checked they are definatly receiving email?

    # April 20, 2011 at 3:29 pm

    I am using the contact form and it works perfectly, the only trouble I have is that people fill the form in Bulgarian and the mail I receive is not readable. I tried defining it in dreamweaver with lang=”bg” but it doesn’t help.. I only receive some symbols and nothing readable.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".