我有一个页面可以确定变量 ISSET,然后根据指令执行操作。例如,如果 isset 包含“打印”,它会通过包含模板路径加载文件并在底部回显打印窗口的代码。
例如。
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);
}
有任何想法吗?
奇妙