jQuery Ajax PHP表单提交

I'm using Ajax contact form where my contactform.php is something like this :

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject = "Contact Form";
$message .= $_POST['name'] . "
";
$message .= $_POST['email'] . "
";
$message .= $_POST['message'];

mail("your@domain.com", $subject, $message, "From: ".$email);
?>

This form script works perfect But My problem is that, My value for "your@domain.com" is dynamic.. So I modified contactform.php to this :

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$emailto = $qc2_options['qc2_form_heading'];
$subject = "Contact Form";
$message .= $_POST['name'] . "
";
$message .= $_POST['email'] . "
";
$message .= $_POST['message'];

mail($emailto, $subject, $message, "From: ".$email);
?>

But this modified script isn't working.. I do get correct value for $qc2_options['qc2_form_heading']; on echo But this form dosn't work.

Where I'm going wrong ?

查看全部
weixin_33712987
weixin_33712987
2012/02/04 16:09
  • post
  • php
  • ajax
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信

0个回复