0

我在这里建了一个表格:http: //22twenty.com/wordpress/contact/

它从标准形式中获得了传统代码

<form id="contact" method="post" action="<?php bloginfo('template_directory'); ?> contact-send.php" class="validateform">

                    <div id="errormessage"></div>
                    <div id="sendmessage">
                        <p>Your message has been sent. Thank you!</p>
                    </div>  

                        <div class="formfield">
                            <input name="name" type="text"placeholder="Name:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <input name="email" type="email" placeholder="Email:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <input name="subject" type="text" placeholder="Subject:" class="text" required/>
                        </div>

                        <div class="formfield">
                            <textarea name="message" class="text textarea" placeholder="Enter Your Message Here:" required></textarea>
                        </div>

                        <div class="formfield">
                            <input type="submit" id="send" value="Post message"  class="btn" />
                        </div>

                </form>

  <?php $name = $_POST['name'];

$email = $_POST['email'];

$message = $_POST['message'];

$formcontent="From: $name \n Message: $message";

$recipient = "get_option('admin_email')";

$subject = $_POST['subject'];

$mailheader = "From: $email \r\n";

mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");

?>

我想知道两件事这是添加表单的最佳方式,我可以在这个意义上使用 get_opition('admin_email') 吗?

谢谢

丹佛

4

1 回答 1

0

您可以使用名为联系表格 7的插件。您可以轻松自定义整个表单以及更多选项和功能,您可以从他们的网站查看文档。希望这会奏效。

于 2012-09-17T06:18:43.393 回答