Printer friendly pages from anywhere on a website. This dynamic "Print This Page" script works right out of the box - cut and paste. Has the option to leave images in the new print friendly page if required. Just link to this script, and it will give a printer friendly version of any page, whether it's a PHP, ASP, CGI, or HTML page. Comes with a Cascading StyleSheet for further control of your print-friendly pages.
Type: application
Version: 1
Requires: PHP 4, Any Platform
Author: the mighty Indian
<?php
/*
PHPrint - Save this as file: phprint.php
Make any Page Printer Friendly!
After installation, you can remove text from here down to the next: 8< ---->
Back up/copy this file first.
1. Save this script in the root of the site for simplicity.
2. Place <!-- startprint --> somewhere in your HTML page where you consider
it to be the start of printer friendly content, and <!-- stopprint --> goes at the end
of that same content.
3. You place a link to phprint.php anywhere on the HTML page (preferably outside the printed content,
like this: <a href="/phprint.php">Print this page</a>
- or however you like, just as long as you link to this script.
*/
//Do you want to strip images from the printable output?
// If no, change to "no". Otherwise, images are stripped by default.
$stripImages = "no";
// If you've already tested, you can remove the text from here up to the other: 8< ---->
// That's it! No need to go below here. Upload it and test.
shahrul kassim wrote :1676
i got this error
Warning: feof(): supplied argument is not a valid stream resource in C:\...\phprint.php on line 33
Warning: fread(): supplied argument is not a valid stream resource in C:\...\phprint.php on line 34
can anyone give some suggestion. im using php 5
Kenneth Hamm wrote :1767
Great script. Thank you. Everything works as described
except when used for my forms page. If someone fills in
the text windows on the form then clicks the printer
friendly page link (before submitting the form), the text
windows on the printer friendly page are all blank. Is
there any way to keep the info entered in the text boxes
so it can be printed out with the rest of the form?