Does anyone know if there is a print function for PHP? I'm trying to put a print button on my PHP page so clients can print the entire page from their own computers. I know javascript has such a thing but haven't seen any for PHP.
sleipnir214 is right. You have to use clientsided javascript. And it is easy.
Step 1. Add this code between <head> tags on page You want to be printed:
<script language="Javascript">
<!-- Begin
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
function closeW(){
window.close();
}
// End -->
</script>
Step 2. Use hyperlink for printing on page you want to be printed like this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.