AJAX联系表格未处理

时间:2013-10-29 17:05:12

标签: javascript php jquery ajax

我有一个非常简单的联系表单,我通过AJAX调用发送...唯一的问题是它没有正确发送,我没有发现任何错误。

相关的JavaScript块:

$('#feedbackSubmit').click(function() {
//send the stuff
$.ajax({
  type: "GET",
  url: "./br.php",
  data: { 'name': $('#fName').val(),
          'email': $('#email').val(),
          'subject': $('#subject').val(),
          'message': $('#message').val()
    }
});

相关的PHP块:

$fName = $_GET["name"];
$from = $_GET["email"];
$sub = $_GET["subject"];

if($_GET['desc']) {
  $desc = $_GET["desc"];
  //formatting of the body of the mail
}

else {
  $desc = $_GET["message"];
  //format the body again
}

也许我只是看着这个,但我似乎找不到导致问题的原因......

注意:尝试使用GET和POST ...在调用级别和模板级别尝试使用PHP文件。

0 个答案:

没有答案