I have a page that doubles as the print page and email version of a page on our website. The page cannot be found by the user but loads in an iframe and either prints or emails depending on what button the user pressed to load it via GET. ie. ?purpose=print ?purpose=email
Now the print function triggers JS window.pint() whereas the email function uses PHP html mail. In order to get the contents of the entire page I used OB functions
ob_end_start();
// page content
ob_get_contents();
ob_end_clean();
This though is cowing up my print function and other JS on the page. Is there another way of getting the content of the page and passing it to the $message parameter of the email?
Any ideas,
Marvellous
You mean using the OB functions affects the proper display of your page?
Have you tried something like that:
What this does is output the page normally if
purposeis not set or is something other than “email”. If you want to send the email and display the content, then just replaceob_end_cleanwithob_end_flush(in that case you don’t need the if-condition).