Re: Access a printer via PHP

From: Date: Fri, 09 Feb 2001 01:20:12 +0000
Subject: Re: Access a printer via PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38743@lists.php.net to get a copy of this message
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" <info@thover.com> To: <php-general@lists.php.net> 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#38743) next »