treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] HELP! FORM USING PHP??

  • Hello,
    I am working on a site which is in a different language, and have added a form to a page called request when clicked submit it is processed by a page called contact.php and so when the user has clicked submit they should be redirected to a page called thankyou.html letting them kno3 their message has been sent, i have put the HTML and PHP code for the form below, and wondering if someone can me know what is the issue with the form because it is not letting me sent an email it displays message failed every time i try the form and is not connecting to thankyou.html , so let me know, thanks.

    HTML



    نام دستگاه


    برند دستگاه


    ظرفیت دستگاه


    مدل دستگاه


    سال ساخت دستگاه



    توضیحات اضافی



    نام و نام خانوادگی شما


    تلفن همراه


    تلفن ثابت


    فکس


    ایمیل



    توضیحات اضافی







    PHP,
    <?php<br />
    $nmachine = $_POST ['nmachine'];
    $bmachine = $_POST ['$bmachine'];


    if(isset($nmachine) && isset($bmachine) ){
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html;charset=utf-8' . "\r\n";
    $headers .= "company name";
    $to= 'email@gmail.com';
    $subject= 'company form';
    $message= "$nmachine, $bmachine";
    if(@mail($to, $subject, $message,$headers)){
    header("location:./thankyou.html");
    }
    }
    else{
    echo "Message Failed";

    }


    ?>
This discussion has been closed.
All Discussions