Forum Moderators: coopster

Message Too Old, No Replies

Server side printing using PHP

         

nodehopper

5:22 pm on Apr 20, 2009 (gmt 0)

10+ Year Member


I am completely new to PHP. I have a small MySQL database here at work with all the information for our Micro Biological Samples. A previous employee wrote up some internal web pages that interact with the database. The employee has left and I now need to move everything over to a WAMP Server. He had originally set it up on LAMP. Many of the pages have simply required editing paths and the database connection parameters. Not too tough, but now I am stumped.

I plan on learning PHP, but before I have the luxury of time to do that I need to get a couple interfaces working ASAP. Both rely on PHP to print barcode labels with information taken out of the database and is formatted in a temporary .prn file. As far as I can tell this all functions except for the printing. The previous employee used the smbclient in linux which is of course not available on Windows Server.

Here is the code that I think does the printing.

$fhandle=fopen("strainlabeltemp.prn","w");
fwrite($fhandle,$labelText);
fclose($fhandle);
print("<!-- $labelText -->\n");
$results=`/usr/bin/smbclient -N //labelprint/ZEBRA -c 'print strainlabeltemp.prn' 2>&1`;
print("<!-- Results: $results\n -->\n");

Can anyone show me how to edit this so instead of calling smbclient on a LAMP server it will send this to the Zebra printer that is set up on the WAMP server as LPT1. Please remember I am not familiar with PHP so I need a reply back that is geared toward a completed idiot like me.

Thanks in advance for any help with this!

Stephen

coopster

8:26 pm on Apr 24, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, nodehopper.

I'm not familiar with Windows servers but perhaps the PHP manual page for the Windows only extension Printer [php.net] will be helpful. Anybody else have some direction?