Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php printing

Status
Not open for further replies.

tshey

Technical User
Dec 28, 2005
78
AU
I have created a access page for a company and they would like a print button or link that eases the confusion for those iliterate computer persons. How do I do this?
 
<?php
echo "
<form>
<input type=\"button\" value=\"Print this page\" onClick=\"window.print()\">
</form> ";

Is that what you want?
 
So that is all it is? That will allow the page to be printed?
 
Can this print a database? I have a database table displayed and want to print it. I s this possible?
 
It will print what's displayed in the browser window.
 
Do I put this code in the body of my document? Is there something missing in the code it does not seem to be working?
 
It works forget my last posting. Thanks guys, this is such a great forum, and everyone is sooooooo smart!
 
Just one more query. Because the webpage is wider than what can be printed on a A4 paper, how can I set this up so it is printer friendly?
 
this gets tricky.

i gather that the new version of iexplorer will fix this behaviour. meantime i suggest you design a specific set of css styles using the print media descriptor to guarantee you a page width less than an a4 page. lots of stuff on google about designing printable web pages.
 
A 100% wide page is about 100% of the A4. Or letter. Or screen. Or A3. Or all of them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top