dongyan5641 2018-08-04 05:46
浏览 29

如何使它在wordpress中工作bootstrap形式

contact.php

<form id="contact-form" method="post" action="contactproces.php" class="closeForm">
    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <input type="text" name="name" id="name" value="" class="form-control" placeholder="Your name" required="required">
            </div>
        </div>

        <div class="col-md-6">
            <div class="form-group">
                <input type="email" name="email" id="email" value="" class="form-control" placeholder="Your email" required="required">
            </div>
        </div>

        <div class="col-md-12">

            <div class="form-group">
                <input type="text" name="subject" id="subject" value="" class="form-control" placeholder="Subject" required="required">
            </div>
        </div>

        <div class="col-md-12">
            <div class="form-group">
                <textarea class="form-control" name="message" id="message" placeholder="Your message" rows="10"></textarea>
            </div>
        </div>
        <div class="col-md-12 text-center">
            <button type="submit" class="btn btn-template">Send Message</button>
        </div>
    </div>
</form>

contactproces.php

 <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    $formcontent=" From: $name 
  Email: $email 
  Subject: $subject  
  
    Message: $message";
    $recipient = "admin@...com";
    $subject = "Enquiry Form";
    $mailheader = "From: $email 
";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    echo "Thank you for getting in touch..! We will get back you as soon as we review your message.";
 ?>

This is my bootstrap contact form code which is simple and works fine but when i try to use it for wordpress am getting error i tried many things by changing action field .can anyone tell me what real modification i have to do with this contactfrm so this works fine in wordpress.pleasse share the solution

Error: i dont know what possible changes i have to make and how to link those pages in php and where to place the php code.i tried placing contactprocess code in cotact.php before get_header(); and in action i added (action="php the_permalink(); ") . in that its displaying message at the top (Thank you for getting in touch..! We will get back you as soon as we review your message.) without submitting form.and when i try to submit the form it direct to the same link which is domianname/contact/ with home page content and getting mail without content

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探