... I've done some reasearch and I came out with nothing... I need to know how to build a script, also known as 'PRINT THIS PAGE' script...
I really have no idea on how to start...
Can any1 point me in the right direction?
... I've done some reasearch and I came out with nothing... I need to know how to build a script, also known as 'PRINT THIS PAGE' script...
I really have no idea on how to start...
Can any1 point me in the right direction?
That totally depends on what you want, and has very little to do with PHP.
Basically, just link to a printer friendly copy of the page. If you want to go through all the effort, this page could, in fact, be PHP generated, I suppose.
Aside from that, there are some ways to try to make the printer print by javascript command and other ways of assigning a different 'printing' document. Look on the DD scripts library for both... I think.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
from what you're saying...if there is a easier way...I'll chose what you call 'printer friendly copy'...there are php functions that help me to somehow 'clear' the junks from the original web address, or I just...have to build it?
Basically, you would have to build the page with no advertisements, extra little images/items that would cause a printer to use a lot of ink, and other items that people just don't want to print. As far as php functions go, I don't know of any pre-defined functions that would clear all the junk from the original page. You could probably make something using preg_replace or some other items like that.
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
I'd actually suggest you to use css, that'd make it a lot easier. You could use display: none;
That may be helpful.
the only wayt that PHP would help in actually generating the page would be a complex html-parsing script. This is something that would be a challenge to some (if not all) of the best coders here... not just a quick fix. It's certainly possible and easy to theorize... just hard in practice. Mainly, you'd have to program the PHP to know when something should/should not be shown, and how!
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
ok guys. I managed to a print-friendly page, somehow generated by php, it's actually easy... no images...just the news...
I've used
alsoCode:<body onload='window.print()'>
...I got it... thanks guys...Code:<span onclick='javascript:window.print();' class='detaliilnk'>Re-print</span>
Glad to hear it's working for you; and also, thanks for posting your solution. I'm sure it may come in handy for other users to these forums.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
Bookmarks