rekha Posted July 29, 2008 Share Posted July 29, 2008 Hi, I have a php page.In that page i have lots of information.I have the print button in the page to print.Now i want to preview the page before printing.Is there any functions in php for previewing.If anyone knows pls help..... Regards Rekha http://hiox.org Link to comment https://forums.phpfreaks.com/topic/117103-preview-a-php-page-by-clicking-a-button-in-a-form/ Share on other sites More sharing options...
zenag Posted July 29, 2008 Share Posted July 29, 2008 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title><script LANGUAGE="JavaScript"> function displayHTML(printContent) { var inf = printContent; win = window.open("print.html", 'popup', 'toolbar = no, status = no'); win.document.write(inf); win.document.close(); // new line } </script> </head> <body> <div id="printarea">Hello how r u? ...</div><a href="javascript:void(0);" onclick="displayHTML(document.getElementById('printarea').innerHTML)">Print Preview</a> </body> </html> Link to comment https://forums.phpfreaks.com/topic/117103-preview-a-php-page-by-clicking-a-button-in-a-form/#findComment-602342 Share on other sites More sharing options...
rekha Posted July 29, 2008 Author Share Posted July 29, 2008 Hi Thanks.It works.. Regards Rekha http://hiox.org Link to comment https://forums.phpfreaks.com/topic/117103-preview-a-php-page-by-clicking-a-button-in-a-form/#findComment-602352 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.