turpentyne Posted March 6, 2012 Share Posted March 6, 2012 my client changed their mind, and wants a field in the database that toggles to 'printed' if they've printed. I had a simple javascript that generates a button: <style type="text/css" media="print"> @page { size:8.5in 11in; margin: 1cm } .printbutton { visibility: hidden; display: none; } </style> <script> document.write("<input type='button' " + "onClick='window.print()' " + "class='printbutton' " + "value='Print This Page'/>"); </script> But I'm assuming I ought to do this with php - or would it be jquery? , so that when they click the button, I can do a query update to the database. But I can't find any tutorials on it. Searching for it, just brings up the php command, "print" grrr. Link to comment https://forums.phpfreaks.com/topic/258386-php-to-send-to-printer/ Share on other sites More sharing options...
KevinM1 Posted March 6, 2012 Share Posted March 6, 2012 You'd need to use JavaScript/jQuery to do this. Remember, PHP is completely divorced from the browser. It can generate client side code, but cannot react to it. Link to comment https://forums.phpfreaks.com/topic/258386-php-to-send-to-printer/#findComment-1324473 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.