Is there a Php function that sends to the printer a given section of a Web page?

Hello,

Is there a Php function that sends to the printer a given section of a Web page and not the whole of the Web page?
To b exact lets say our Web page is made up of the:
Header
Ad section
Title
Body
Navigation bar
etc.

So is there a Php function or any function (Javascript) that in conjunction with DIV ID allows one just to send to the printer the contents of the Body section of the Web page and not the whole of the Web page?

Regards,

The first one on the list should do: http://www.webcredible.co.uk/user-friendly-resources/css/print-stylesheet.shtml

There are probably posts about it in the Sitepoint css forum.

Hi,

I looked under google for “css print”, but could not readily see exactly what I am looking for. If you know to which exact URL I should go to get the intel I want, which you seem to do, can you directly point me to that URL (Web site)?
This way I avoid having to read through dozens of Google provided URLs :slight_smile:

Regards,

Since most web servers don’t have printers attached having a PHP function that sends anything to that non-existant printer would be rather pointless anyway.

In terms of being able to print a part of a web page client side you can only do that by defining a print stylesheet that hides all of the content that you don’t want to print. Then any attempt to print that web page will print just that part you want to t and the rest of the page will be unprintable unless the person actually overrides your styles.

For those of your visitors with JavaScript enabled you could set up in-page print buttons that hide all but a given section of the page, request that the page be printed to the default printer, and then unhide the rest of the page again. Such options will only work for those of your visitors with JavaScript enabled and they will still be able to print the whole page using the browser print options.

You can setup your webpage with style sheets that only print what you want.

Check out google for “css print”.

Hi,

But what I want to, need to do, is to add a (Printer) button to the body
segment of a page so that when people click on this printer button only the content of the Subject & Body segment of that page, that article, is printed.

For example on this user Blog page:

The printer button should be on the end of the Title bar, upon clicking on which button the Title of:
"WHY Oil catastrophes like in US never happen in Europe! "
would be printed and beneath it the body of the article.

ThanX,