Lightzero Posted June 26, 2007 Share Posted June 26, 2007 Hello.... I have some problem in Print File (I'm using LX300) via dos command.. I'm using This Code : $Input ="TYPE ".$FileName." > ".$_SESSION["Printer"]; system($Input,$value); I have some question : 1. How to get Error Command if Print is failed ?? I only know if $value is 1, the print failed, but I want to see the description like in dos... ex : - Device is not ready - Network path is not found - The queue is full ... 2. The next problem is I only can print if I'm using PRINT SERVER (hardware), If I'm using Printer in computer client, it will failed... Example : Server is Computer A, Client is Computer B (ex. IP and his printer is : //192.10.40.1/LX300)... If I'm run the script above from Computer B, it will failed.... But If I'm run the script above from Computer A, it will successfull. But If I'm using Printer attached in Print Server, It will success... Is there any sollution... Thank you.. Link to comment https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/ Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 1. Use shell_exec. 2. You'll need to be clearer, but basically. The script will only be able to print via a printer the server (machine running the script) has access to. Link to comment https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/#findComment-282592 Share on other sites More sharing options...
Lightzero Posted June 26, 2007 Author Share Posted June 26, 2007 1. Use shell_exec. 2. You'll need to be clearer, but basically. The script will only be able to print via a printer the server (machine running the script) has access to. 1. Can you give me some example with my code... Because I'm using : shell_exec($input); I can't get the status if the command is failed or success... , and i'm also can't get error message. Like my previous command : system($input,$value) Link to comment https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/#findComment-282635 Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 Sorry... if you want output & status use . eg; <?php exec($input,$out,$stat); echo "status is $stat\n"; foreach ($out as $a) { echo "$a\n"; } ?> Link to comment https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/#findComment-282640 Share on other sites More sharing options...
Lightzero Posted June 26, 2007 Author Share Posted June 26, 2007 The status still doesn't show(if failed).... ??? ??? Link to comment https://forums.phpfreaks.com/topic/57187-ask-php-print-file-via-dos-command/#findComment-282650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.