SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create print function

    hi there, i want to be able to print data from my site. i have know idea of how to go about doing this. would someone kindly please help me. I'm using php 5 and mysql 5 and wish to have a button on the a page that gives the option to print the data that is displayed.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2007
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php won't help you much here. But you can trigger the "print page" dialog with javascript
    Code:
    <input type="button" value=" Print this page " onclick="window.print();return false;" />

  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to include a css file for the styles of the site for online display then have a separate css file for print styles. The latter will re-format everything for print out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •