変数ISSETを決定し、命令に基づいて動作するページがあります。たとえば、issetに「print」が含まれている場合、インクルードテンプレートパスを介してファイルをロードし、ウィンドウを印刷するコードを下部にエコーします。
例えば。
if (isset($_GET['quoteprint'])) {
include(TEMPLATEPATH . '/bookings/booking-quote.php');
echo'<script type="text/javascript">window.print()</script>';
}
同様の機能を存在させたいのですが、今回はそのページの内容をユーザーにメールで送信します。私はこれに疲れましたが、うまくいきません。コンテンツを変換する必要があると思いますが、どこから始めればよいのかわかりません。
else if (isset($_GET['quoteemail'])) {
$emailer = include(TEMPLATEPATH . '/bookings/booking-quote.php');
$to = $current_user->user_email;
$subject = "Your Quote - Dive The Gap" ;
$message = $emailer;
$headers = "From: Dive The Gap Bookings <ask@divethegap.com>" . "\r\n" .
"Content-type: text/html" . "\r\n";
mail($to, $subject, $message, $headers);
}
何か案は?
素晴らしい