General Community > Scripting Help

php or Javascript command to print page

(1/2) > >>

Seph|roth:
what is the PHP command to send a request to your browser to print the page?

searching on google with the keywords "php" and "print" doesn't really get you anywhere as you can imagine :P

or maybe the Javascript coomand for it? -- thanks

Aquilo:
<?php
echo 'text';
// or
print 'text';
?>

but the request for the page comes from your browser and Apache starts by sending the headers then the document, php facilitates in compiling the data the document source will contain.

or this is my interpretation of how it works! :-\ ;D

Seph|roth:
ehm... thanks aquilo... but i know how to 'print' text with php :P

what i mean is the command to issue your browser to print the page (like in a printer, with ink and paper and all that stuff, y'know? ;))

Aquilo:
oh that's javascript, php is server side while you'll need something client side to print "javascript"!


[edit]
"last post", befor someone bits my head off - php don't compile the script it interprets it then sends it on.
if not scripted right the browser can not render it correctly, an example would be sending headers telling the browser to render an image/jpg and actually sending plain text will produce a blank image placeholder. :P
[/edit]

Seph|roth:
ok, so do you know the command in JS? something like document.parent.print() or something i guess?

Navigation

[0] Message Index

[#] Next page

Go to full version