Jump to content

Archived

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

member

PHP Include Print Only (may need javascript)

Recommended Posts

Hi,

I am wondering if anyone can give me or knows a code which prints a certain part of a webpage either a PHP include bit or a certain part of a webpage. Is there a way, if so please let me know. The print button will be an image not a standard button (form).

Also, "Print Window" method won't work, because it will print the entire site.
Thank You .
Your help is most appreciated

Share this post


Link to post
Share on other sites
You can use an activex program called scriptx. It is free and you can tell your web page what to print and what not to just by putting it in a certain class or between <div> tags. I use it to print up mysql web reports so there is nothing on the page BUT the report.

http://www.meadroid.com/scriptx/freedep.asp

Ray

Share this post


Link to post
Share on other sites
Thanks, but the url don't work, tried another site: http://www.jibbering.com/accessibility/install-scriptx.html

Installed it, but all it says is "Scriptx 5.5 was successfully installed" and it is not on my program files or anything?

Where is it?, is it installed as part of a programme?

oh no it works!!
thanks

Share this post


Link to post
Share on other sites
It makes the most sense (to me) to have two separate stylesheets - one for media=screen, one for media=print.  The print CSS stylesheet simply uses 'display:none' for everything on your html page that you do not want sent to the printer.  That gives you printer-friendly pages with nothing more than one extra CSS file and uses the javascript window.print method

Need an example?  Look at www.digitalmidget.com/php_noob/comment.php and use the 'file>print preview' option in your browser to see what would be printed from any page (or go ahead and hit the 'print page' image/link) on that page.

Share this post


Link to post
Share on other sites
Url works fine for me. That is the description of the program, you need to go to downloads on the left to get the program

http://www.meadroid.com/scriptx/sxdownload.asp

Share this post


Link to post
Share on other sites
Problem I have always have is the page numbers show up on top and the site shows on the bottom when you print. I know the CLIENT can shut them off, but why make them do it. The scriptx app shuts them down automatically. I have had good luck with it but I am sure there are alot of different ways to do it.

Ray

Share this post


Link to post
Share on other sites
I downloaded, And havn't got a clue how to use this, i'm new to php. It only appears on my start menu Under
"Mead & Company" >> "Licencse Manager" <<<<<<<<<<<<<That's it, it's only a license stuff.

any idea?

Share this post


Link to post
Share on other sites
oh yeh Thanks AndyB!! u helped me a lot, for that random .txt loader thing, I appreciate that, hought i'd tell u while ur here.
U can see a test on: http://islamcentre.awardspace.com/test/test2.php (just a test, one file missing).

anyways wheres that craygo gone....

Share this post


Link to post
Share on other sites
Or i got another idea. What about it opens a new window a printer friendlier version with only that part in it.
But problem is, is that it is a random text loader, just the same as the url as above that i gave to andyb. So it will change the text.

Share this post


Link to post
Share on other sites
You can do that but you will get all the other crap on the top and bottom of the page

Ray

I am giving you a tutorial now one sec

Share this post


Link to post
Share on other sites
ok thanks, tutorial will be helpful a lot, i newbie as i told u before, so it will take a lot of telling to get it throught my head.
an example could be on: http://www.fisabilillah.org/ scroll down and u should see a "HAdith" it has a green print button, don't mind something like that, but i think it will require me to give them an id for each quote, which won't help because there are thousands of quotes. Thanks again...

Share this post


Link to post
Share on other sites
OK this forum will not let me post the code I keep getting an error!!!

Share this post


Link to post
Share on other sites
Craygo, lost internet connection, can u come back pls?

[quote author=craygo link=topic=108519.msg436688#msg436688 date=1158603808]
sent e-mail
[/quote]

Share this post


Link to post
Share on other sites
is there another way, such as using tags?

like this
------------------------------------------------
other content
<print this bit>
to be printed part
</print this bit>

other stuff on site
------------------------------------------------

thanks

Share this post


Link to post
Share on other sites
[quote author=member link=topic=108519.msg455796#msg455796 date=1161519675]
is there another way, such as using tags?

like this
------------------------------------------------
other content
<print this bit>
to be printed part
</print this bit>

other stuff on site
------------------------------------------------

thanks
[/quote]

[b]YES![/b], and very, very, simply. Use CSS to define what is shown when a page is seen on screen and what is seen when the page is printed. Reply #3 in this thread explains.

Share this post


Link to post
Share on other sites
Hi AndyB , could you please explain to me and show me how to do this?

Long time since last post.

Thanks

Share this post


Link to post
Share on other sites

×

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.