Jump to content


Photo

PHP Include Print Only (may need javascript)


  • Please log in to reply
18 replies to this topic

#1 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 05:42 PM

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

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 05:45 PM

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....ptx/freedep.asp

Ray

#3 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 05:50 PM

Thanks, but the url don't work, tried another site: http://www.jibbering...ll-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

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 18 September 2006 - 05:52 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#5 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 05:52 PM

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..../sxdownload.asp

#6 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 05:56 PM

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

#7 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 05:59 PM

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?

#8 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 06:03 PM

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.a.../test/test2.php (just a test, one file missing).

anyways wheres that craygo gone....

#9 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 06:06 PM

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.

#10 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 06:10 PM

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

#11 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 06:13 PM

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...

#12 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 06:16 PM

OK this forum will not let me post the code I keep getting an error!!!

#13 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 18 September 2006 - 06:23 PM

sent e-mail

#14 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 06:24 PM

keep checking ur inbox, refresh it , every mome

#15 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 07:35 PM

i'm back u there?

#16 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 18 September 2006 - 08:58 PM

Craygo, lost internet connection, can u come back pls?

sent e-mail



#17 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 22 October 2006 - 12:21 PM

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

#18 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 October 2006 - 12:24 PM

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


YES!, 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.
Legend has it that reading the manual never killed anyone.
My site

#19 member

member
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts

Posted 23 September 2007 - 06:46 PM

Hi AndyB , could you please explain to me and show me how to do this?

Long time since last post.

Thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users