Hey guys I am scripting with PHP and I need to write a web page that has a print page link which when clicked prints out a print friendly page. Thanx in advance.

Recommended Answers

All 6 Replies

And your question is?

This can be done using java script.

<a href="whatever.htm" onClick="window.print();return false"><img src="print.gif"></a>

I want to print the page with PHP in cae javascript is disabled on the client's machine. I don't know but I am sure there is a way to do this in PHP.

i dont want to print a full page. I just want to remove header part and footer part of my web page during the print section. Is this possible? If yes, then how? thanks in advance.

Removing the headers and footers can be changed by the user's printer settings. So; I dunno of a code that removes the headers or footers. But as far as printing is concerned, you should use vibhaj's suggestion.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.