Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End My contact form doesnt work

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24504
    wingye
    Member

    Hi there,

    I have been looking on the internet to fix my lil problem i have with my contact form. But i doesnt seem to find the answer for it. Thats why i am going to bothering you guys here and hope you dont mind and help me out with this problem which is really small for most of you but for me its a disaster.

    My problem is as follow:
    I have a contact form in HTML when press submit it use PHP script to mail to me.
    But when error or succes it redirect to a specific page. But unfortunately i cant get this to work.

    Below is the form n HTML

    Code:








    And here is the PHP script

    Code:
    “;
    exit;
    }

    // prepare email body text
    $Body = “”;
    $Body .= “name: “;
    $Body .= $name;
    $Body .= “n”;
    $Body .= “company: “;
    $Body .= $company;
    $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
    if ($success){
    print ““;
    }
    else{
    print ““;
    }
    ?>

    I hope you guys can help me out,

    Thanks Alot for your time

    #55898
    wingye
    Member

    Is there anyone who can help me out with this bit pls ..

    #55899
    apostrophe
    Participant

    Not sure what you are asking.
    The whole thing doesn’t work or just the page redirect?

    #55896
    wingye
    Member

    thnx for you time, well its the whole thing that doesnt work.
    It doesnt send any mail out and it keep redirecting to the error page not matter what.

    wing

    #55897
    ikthius
    Member

    doing a basic test can help see where it is dying, like at each stage, write something out to the page:
    e.g. if your php filled the body of the mail, echo it out, perform something for each stage to see when it dies…
    echo = "body populated";

    "wingye" wrote:
    thnx for you time, well its the whole thing that doesnt work.
    It doesnt send any mail out and it keep redirecting to the error page not matter what.

    wing

    are you on a windows server?
    if so you need to set your ini in php

    plus enquiry & message are not the same!!! you might want to change one.

    mind you it looks like the script I use, but I $_REQUEST my HTML elements

    e.g.

    Code:
    $name = $_REQUEST[‘name’];
    $tel = $_REQUEST[‘tel’];
    $email = $_REQUEST[’email’];

    also this is my success:
    $success = mail($EmailTo, $Subject, $Body, "From: <$email>", "-froot@my-email-address");

    hopefully these small hints may help get it working

    #57404
    raymondselda
    Member

    Maybe I can help you with your problem. I have written an article on my blog on creating a contact form using PHP and jQuery for validation. It’s really simple and short. I hope you will find my article helpful. Thank you.

    http://www.raymondselda.com/php-contact … alidation/

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.