This is not a how to code type question rather it is an approach that needs to be taken if possible.
Using PHP/MySQL I would like to have a user view something on their screen and then if they decide to print it out add a value from the db. This value should not display on the computer screen though.
Basically the physical medium print job (or print to pdf, etc.) needs to contain an additional value from the db than what screen print would render if the user just copied their screen in some way.
Is this possible? If so what needs to be accomplished to make it all happen?
This is doable with plain HTML and the correct CSS media types. You need only place the print-specific stuff into a container that is designated not to display on screen by CSS:
Inside
print.css:Inside
screen.css:In your HTML:
Inside the header, use the correct CSS links:
And enclose the content in a container with class
printonly. This won’t display on screen (in any modern browser) but will be printed out.