Jump to content

Print specific part of page.


art15

Recommended Posts

Hi All,

 

I was wondering if it is possible to print specific part of page using php?

 

Also, if I have 10 products on page which are all database driven, if I put a check box next to each product with a button to print that product. Is it a way by which I can select the detailed product page for that product on checking that option box and printing that product.

 

Come on freaks help me with this.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/104330-print-specific-part-of-page/
Share on other sites

You seem to be asking for several different things in your post, but some of it is a little convoluted.

 

You say you want a checkbox and a button for each product? Why do you need the checkbox if you are going to have a button next to each product? or, if you are saying you want only 1 button for the page, then what do you want to have happen if multiple product checkboxes are checked?

 

The easiest (and most fool-proof) method is to simply open a new page with just the information you want printed.

 

As for printing specific parts of a page, that can be accomplished with CSS. Just use classes within your page and then use the "media" type to specify whether certain content should be printed or not.

 

<style>
  @media print {
    noprint { display: none; }
  }
  @media screen {
    noprint { display: inline; }
  }

</style>

...
<span class="print">This will be printed</span>
<span class="noprint">This will NOT be printed</span>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.