-2

Unfortunately searching this on Google is very difficult due to the print() function. I have a form that posts to a page that creates an image based on the submitted values. I need to make it so that after creating the image it opens the print dialogue.

Should be simple enough, but it's late and I'm lazy -_-

watzon
  • 2,401
  • 2
  • 33
  • 65

2 Answers2

3

PHP itself can't do this, afterall it is a server side language and what you're asking to do is client side functionality.

Perhaps Javascript's window.print() method is what you are after?

Michael Pasqualone
  • 2,027
  • 2
  • 15
  • 23
0

I would say after it creates the image it should have a javascript function to open the print dialogue. Something like:

<?php
if($imageisdone){
echo "<script>window.print();</script>";
}
?>
bozdoz
  • 12,550
  • 7
  • 67
  • 96