在angularjs中使用php的联系人表单

在angularjs中使用php的联系人表单,php,angularjs,forms,post,Php,Angularjs,Forms,Post,html: 查看/contactform.html <form method="post" role="form" name="myemailform" action="sendingemail.php"> <div class="form-group"> <input type="text" name="name" class="form-control" id="name" place

html:

查看/contactform.html

<form method="post" role="form"  name="myemailform" action="sendingemail.php">
                  <div class="form-group">
                    <input type="text" name="name" class="form-control" id="name" placeholder="Your Name" data-rule="minlen:4" data-msg="Please enter at least 4 chars" />
                    <div class="validation"></div>
                  </div>
                  <div class="form-group">
                    <input type="email" class="form-control" name="email" id="email" placeholder="Your Email" data-rule="email" data-msg="Please enter a valid email" />
                    <div class="validation"></div>
                  </div>
                  <div class="form-group">
                    <input type="text" class="form-control" name="subject" id="subject" placeholder="Subject" data-rule="minlen:4" data-msg="Please enter at least 8 chars of subject" />
                    <div class="validation"></div>
                  </div>
                  <div class="form-group">
                    <textarea class="form-control" name="message" rows="5" cols="10" data-rule="required" data-msg="Please write something for us" placeholder="Message"></textarea>
                    <div class="validation"></div>
                  </div>
                  <div class="text-center"><input type="submit" class="btn applyBtn" name="submit"/></div>
              </form>
我希望在angular项目中有一个联系人表单,我在view/contactform.html和sendingeemail.php中提供了表单,以提交表单详细信息。但是当我提交表单时,我只是看到sendingemail.php代码,没有完成表单提交。需要帮助


这意味着您的Web服务器无法识别要作为php文件运行的php文件。您可能需要检查Web服务器的文档以安装和/或启用PHP模块。

您是否正确配置了apache?您使用的是哪种Web服务器?我使用的是apache服务器
<?php

$name = $_POST['name'];
$email_from = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];

$emails = "From: $email_from \r\n";
$emails .= "Name: $name \r\n";

$emails .= "Message: $message \r\n";



mail('sunitha_anilkumar@yahoo.com',$subject,$emails);
echo 'Mail sent!';
header('Location: thank-you.html');
?>
.when('/contactus', {

                templateUrl: 'view/contactform.html',
                controllerAs:'vm'
            })