The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hello, everyone. I am looking for a simple script to implement on my web site that will let users print my pages (without background colors, more readable, etc.) I am very fluent in scripting languages (ASP, JScript, VBScript, ADO, etc.), so implimentation shouldn't be a problem. Please post a response as this would be a great help to my web site. It would also be intriguiging to know how SitePoint does it themselves (for all you SitePoint Admins out there). Thanks!

Since all of our content resides in a MySQL database, our printable article view is simply a different PHP script that formats the text of our articles appropriately. If you want to discuss this further, however, the conversation would best be moved to the server-side scripting forum.

By looking for a client-side solution I think you'd be making a lot of extra work for yourself...

I think he was referring to Printer-Friendly Versions of pages, and Kevin's right: it's a bit more complex that that.

Quite simply, you want to have a page, say, "print.php" - on the link to view a printable version on your article page (let's say the URL of the article is "article.php?id=1") - you'd create a link within PHP like this:

echo("<a href=\"print.php?id=$id\">View A Printable Version</a>");

So, in this case, going to the article with an ID of "1" would produce a link leading to "print.php?id=1" - from then on, it's simple: you have the print.php page check for the variable "$id" - and if it exists, grab the corresponding record from whatever database you're using.

Hey,
Here's a simple way of doing what you want. On the page you want to print just link to this file. On each page you wan't to be printable just put <!-- body --> and <!-- /body --> around the content. The script then pulls the text and displays the content in anyway you want.