dongyu1983 2018-08-10 11:40
浏览 134

使用计算字段表单插件

I'm using 'Calculated Fields Form' plugin for WordPress. I have already created my form but it is not a premium version and I have to use HTML , CSS and JQuery to build a php file to email my customers request to my email . my php file :

$computers = $_POST['fieldname2_1'];
$servers = $_POST['fieldname3_1'];
$branches = $_POST['fieldname4_1'];
$support = $_POST['fieldname5_1'];
$price = $_POST['fieldname1_1'];
$name = $_POST['fieldname7_1'];
$email = $_POST['fieldname12_1'];
$phone = $_POST['fieldname8_1']; 
$to = 'danialskh@yahoo.com';
$subject = 'network supporting request';
$message = 'FROM: '.$name.' Email: '.$email.'Message: '.$message;
$headers = 'From: danialskh@yahoo.com' . "
";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) { // this line checks that we have a valid email address
    mail($to, $subject, $message, $headers); //This method sends the mail.
    echo "درخواست شما ارسال شد !"; // success message
    }else{
        echo "ایمیل اشتباه است ! لطفا ایمیل صحیح را وارد کنید .";
    }

and I have this in my :

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script>
$(document).ready(function(){
$("#fieldname11_1").click(function(){
    $("#cp_calculatedfieldsf_pform_1").attr("action", "http://ariyannet.com/module/wp-content/themes/twentyseventeen/networkcustomer.php");
    $("#fieldname13_1").attr("type", "submit");
    $("#field_1-6").fadeIn(1000);
});
$("#fieldname14_1").click(function(){
    $("#field_1-6").fadeOut(1000);
});
$('#fieldname13_1').click(function() {
         $('#fieldname13_1').attr('value', 'لطفا صبر کنید ...');
         $.post("http://ariyannet.com/module/wp-content/themes/twentyseventeen/networkcustomer.php", $("#cp_calculatedfieldsf_pform_1").serialize(), function(response) {
             $('#fieldname15_1').html(response);
             $('#fieldname13_1').attr('value', 'ارسال');
         });
         return false;
});
});
</script>

but when I click on submit button of form , nothing happens !!! and if I don't use Jquery , after clicking on button , browser just shows me a raw version of my php file

anybody can help me ?

</div>
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog