You cannot directly access a printer from a php script.

but you can try locating a a command line utility which will print the data
provided to it in the command line or a the contents of a filename provided
in the command line to the printer connected to the server. If the data is
quite large ( in the sense let's say a reciept as it seems in your case),
you might write the data to a temporary file and pass the filename to the
priniting utility using the exec() command in PHP.

You can obviously make the updates to teh database on the pHP page and call
the exec() command once the transaction is completed..

hope that helps

Ankur Verma
HCL Technologies Ltd,
A1CD, Sector16, Noida
UP, India



----- Original Message -----
From: "ThoVer Webproducties" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 7:02 PM
Subject: [PHP] Access a printer via PHP


> Hello,
>
> For an e-commerce project we want to connect
> the mySQL-database we created to a printer
> (attached to a computer which has 24h
> internet [and mySQL database] access). I
> assume it's different to couple the
> mySQL-database directly to a printer.
> We are however accessing the database via
> PHP, so I think it might be possible to send
> a command to a printer directly from the PHP
> file which puts the data into the database as
> well.
>
> We want to do this in order to have an order
> via the website printed directly. In fact,
> the printer should start printing as soon as
> an order is added to the seperate table in
> the mySQL database (by a special PHP
> document).
>
> Does anyone know whether this is possible
> and, if it's possible, could you tell me how?
>
>
>
>
> Thanks in advance,
> Thomas.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to