我有我的wordpress網站的簡報形式,應該通過短碼被使用:WordPress的外部PHP文件
<form action="newsletter.php" method="post">
...
</form>
而簡碼應該是:
[newsletter]
在我的主題選項我有一個輸入字段來輸入電子郵件地址。該值需要存儲在變量$ newsletter.php到
我怎樣才能'連接'與wordpress get_option newsletter.php爲我的輸入?
newsletter.php:
<?php
$email = $_POST['news'];
// --- this should be the option from the wordpress panel -------
$to = "[email protected]";
// ---------------------------------
$subject = "newsletter request";
$date = date("d-m-Y");
$email_message = " Newsletter request : \r\n";
$email_message .= " ================================================== \r\n ";
$email_message .= "This user wants to be notified about your website launch : ".$email."\r\n";
$email_message .= " ================================================== \r\n";
$email_message .= " Request was sent " .$date. " \r\n";
$headers = 'From: '.$email."\r\n";
if($email != null && $email != ""){
mail($to,$subject,$email_message,$headers);
}
header("location:../index.php");
?>
我試圖與REQUIRE_ONCE但是,這是不工作...
也許我不明白,找到但爲什麼你需要要求 - 要求得全自動newsletter.php。如果我錯過了,請更多地解釋你真正想要的。我的意思是你需要哪個文件在哪個文件中。感謝美國廣播公司抱歉,如果我錯過 – ZigZag
$不改變,當我在我的管理面板中更改它...有任何想法,我該怎麼做? – BBee