Clancy wrote:
Oh?
Unfortunately I have had great difficulty trying to find out how
things really work, as all the books I have seen are recipe books,
which tell you how to achieve particular results, but not what is
going on behind the scenes.  I had assumed that when you hit the
'print' button the browser sent a new request to the server, with a
different set of parameters, but I gather from your reply that the
browser issues the new (printer) page without reference to the server.
Is this what actually happens?

If so I fear I will have to work out how to achieve the results I want
with CSS styles.  It would have been far simpler if I could have done
it in php.

Thank you for your help.

On Wed, 3 Dec 2008 14:34:20 +1300, [EMAIL PROTECTED] ("German Geek")
wrote:

PHP is a server side language...

On Wed, Dec 3, 2008 at 2:16 PM, Clancy <[EMAIL PROTECTED]> wrote:

Is it possible to access the 'media' attribute from php, so (for
example) you can tailor a page for printing?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Rule #1 on this list: don't top post.

That is how it works indeed, you request the page, the server runs the php script, collects the output and sends it to the browser. You view the page in the browser, press print, the browser sends the page data to the printer spooler which sends it to the printer. No PHP involved after it was sent from the server back to the browser. You basically have 2 options now:
1. change the looks trough a different stylesheet (the pretty option)
2. add a "print" button/link on your page which, when clicked, will redirect to a new page in "print format". Then use the javascript print function to call up the browser's print dialog.

As for books, most PHP books aren't recipe books, so you've been looking at the wrong ones :) I can recommend O'Reilly's books, they're pretty good. Especially Programming PHP [1]. But that's just my general liking of those books ;)

- Tul

[1] http://oreilly.com/catalog/9780596006815/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to