Re: print script
| From: | Sarah Gray | Date: | Fri, 21 Jan 2005 01:45:04 +0000 |
| Subject: | Re: print script | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17065@lists.php.net to get a copy of this message | ||
There's javascript that prints the window (if you're not on a mac or certain
browsers, I forget which ones).
Do a js check to see if that functionality is available and if it's not just
tell the user to print from their file menu:
<script language="JavaScript">
if( window.print ){
document.write('<a href=\"javascript:window.print();\"> click here to print
this page</a>.');
} else {
document.write('Select print from the file menu to print this page..');
}
</script>
Jeff Jordan wrote:
> I am not familiar with printing data from a website I do not know what is
> the best way to print data as well. I want my user to select elements from
> dropdowm selections that builds a SQL statement:
>
> Select <table from a dropdown list> WHERE <from a dropdown> ORDER by <from a
> dropdown>;
>
> Now, I can echo the results back to a php screen. Is there a quick and dirty
> script available that will print the screen to a printer easily or is it
> better to print it to a PDF then display it and then to print the PDF.
> Examples and suggestions much appreciated!
>
> Humbly thankful,
> Jeff
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php