title: Server side printing in PHP 5
body: <p>How can i print my html file via php script? I just want to run it in background without any prompt. I have read other posts regarding this but still didnt find anything working.
  I tried this one :</p>
  
  <pre><code>&lt;?php
  $dir = "temp"; // the folder that you are storing the file to be printed
  $file = "file.html"; //change to proper file name
  $file_dir = $dir.$file;
  $server = "home_computer"; //name of the computer you are printing to on your network
  $printer = "HP"; //printers shared name
  $command = "print $file_dir /d:\\$server\\$printer";
  exec($command) or die("File failed to print");
  ?&gt;
  </code></pre>
  
  <p>got this example here <a href="http://www.phpfreaks.com/forums/index.php/topic,207946.0.html" rel="nofollow">http://www.phpfreaks.com/forums/index.php/topic,207946.0.html</a></p>