Forum Moderators: coopster

Message Too Old, No Replies

Printing directly from PHP

printing from PHP

         

The_Tanner

10:03 am on Apr 3, 2006 (gmt 0)



Hello Everyone,

Currently I work in a school and I wish to build a PHP/MySQL portal which allows teachers to enter student exam marks online through the portal.

The same site will provide reporting etc. and prints the result of each student on a separate page, which can then be sent by post.

In order to print the results I wish to create a print button (or something similar) which once pressed, extracts the individual student details from the Database and sends them directly to the printer without outputting anything on the screen. IS this possible with PHP?

Thanks and Regards

Habtom

10:19 am on Apr 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think this time too, sending the output to a pdf file and printing without displaying the file is possible. But I am sure somebody will give you a better response.

Habtom

eeek

1:02 pm on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could use popen to send the output to lpr.

orion_rus

1:23 pm on Apr 4, 2006 (gmt 0)

10+ Year Member



I think a dialog printing box will appear always

whoisgregg

10:21 pm on Apr 4, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP Printer Functions [us3.php.net]
These functions are only available under Windows 9.x, ME, NT4 and 2000. They have been added in PHP 4.0.4.

Read the first comment on the linked page for a way to do it in *nix with lpr and a comment further down for how to do it with lp.