Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Pretty print with PHP?

 
Goto page 1, 2
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Next:  Ping Grey - ok - review and slay!  
Author Message
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 1) Posted: Fri Aug 13, 2004 8:05 pm
Post subject: Pretty print with PHP?
Archived from groups: alt>www>webmaster (more info?)

Hey folks,

I figured I'd try and get a few more semi-on-topic threads going Wink

Okay. I have a couple of sites where the entire contents of most pages are
dynamically generated from a database using PHP. Now although they are
syntactically correct in their markup, it looks bloody ugly should one
ever have to look at the outputted HTML for debugging purposes Sad

I know that you can use a buffer in PHP and not have any of the code
output until you are ready, but is there any way of applying some sort of
pretty printing to the code so it's not so ugly perhaps using a buffer or
a simpler process?

--
Dylan Parry
http://webpageworkshop.co.uk - FREE Web tutorials and references

Listening to: Mike Oldfield - Islands

 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 952



(Msg. 2) Posted: Fri Aug 13, 2004 8:05 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 13 Aug 2004 17:05:48 +0100, Dylan Parry <usenet DeleteThis @dylanparry.com>
wrote:

 > Hey folks,
 >
 > I figured I'd try and get a few more semi-on-topic threads going Wink

Be careful. Soon that type of thing is going to be considered "spam"
around these parts.

 > Okay. I have a couple of sites where the entire contents of most pages
 > are
 > dynamically generated from a database using PHP. Now although they are
 > syntactically correct in their markup, it looks bloody ugly should one
 > ever have to look at the outputted HTML for debugging purposes Sad
 >
 > I know that you can use a buffer in PHP and not have any of the code
 > output until you are ready, but is there any way of applying some sort of
 > pretty printing to the code so it's not so ugly perhaps using a buffer or
 > a simpler process?

Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy" target="_blank">http://www.php.net/tidy</a>

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollory that nothing is ridiculous.
- <a style='text-decoration: underline;' href="http://www.greywyvern.com" target="_blank">http://www.greywyvern.com</a> - Orca Knowledgebase: Completely CSS styleable
Knowledgebase/FAQ system<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
oeb1

External


Since: May 25, 2004
Posts: 20



(Msg. 3) Posted: Fri Aug 13, 2004 8:19 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Dylan Parry" <usenet.RemoveThis@dylanparry.com> wrote in message
news:pan.2004.08.13.16.05.47.236128@dylanparry.com...
 > Hey folks,
 >
 > I figured I'd try and get a few more semi-on-topic threads going Wink
 >
 > Okay. I have a couple of sites where the entire contents of most pages are
 > dynamically generated from a database using PHP. Now although they are
 > syntactically correct in their markup, it looks bloody ugly should one
 > ever have to look at the outputted HTML for debugging purposes Sad
 >
 > I know that you can use a buffer in PHP and not have any of the code
 > output until you are ready, but is there any way of applying some sort of
 > pretty printing to the code so it's not so ugly perhaps using a buffer or
 > a simpler process?


This might be helpful
<a style='text-decoration: underline;' href="http://www.zend.com/php5/articles/php5-tidy.php" target="_blank">http://www.zend.com/php5/articles/php5-tidy.php</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 4) Posted: Fri Aug 13, 2004 8:23 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Engaging mouth before brain, oeb -=- bleh bleh bleh wrote:

 > This might be helpful
<font color=purple> > <a style='text-decoration: underline;' href="http://www.zend.com/php5/articles/php5-tidy.php</font" target="_blank">http://www.zend.com/php5/articles/php5-tidy.php</font</a>>

Unfortunately, that relies upon an extension that I cannot guarantee will
be present on the server. I'm also not using PHP5, so it isn't really an
option without having to install the extension.

Thanks anyway,

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references

Listening to: Mike Oldfield - When The Night's On Fire<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 5) Posted: Fri Aug 13, 2004 8:28 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Engaging mouth before brain, GreyWyvern wrote:

<font color=purple> > Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>

Unfortunately not. Shared hosting etc. I could ask the host if they would
be willing to, but it's probably more hassle than it's worth Smile

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references

'I am a Bear of Very Little Brain, and long words bother me.' -- A A Milne<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
comments

External


Since: Sep 14, 2004
Posts: 1625



(Msg. 6) Posted: Fri Aug 13, 2004 9:15 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 13 Aug 2004 17:05:48 +0100 Dylan Parry
<usenet.RemoveThis@dylanparry.com> broke off from drinking a cup of tea at to
write:

 >Hey folks,
 >
 >I figured I'd try and get a few more semi-on-topic threads going Wink
 >
 >Okay. I have a couple of sites where the entire contents of most pages are
 >dynamically generated from a database using PHP. Now although they are
 >syntactically correct in their markup, it looks bloody ugly should one
 >ever have to look at the outputted HTML for debugging purposes Sad
 >
 >I know that you can use a buffer in PHP and not have any of the code
 >output until you are ready, but is there any way of applying some sort of
 >pretty printing to the code so it's not so ugly perhaps using a buffer or
 >a simpler process?
 >

Aaaaaaaaaaaaagh!

Don't they teach English at school anymore? "outputted" what sort of
word is that supposed to be?

Matt<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
spam19

External


Since: May 08, 2004
Posts: 952



(Msg. 7) Posted: Fri Aug 13, 2004 9:15 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 13 Aug 2004 18:15:43 GMT, Matt Probert
<comments RemoveThis @probertencyclopaedia.com> wrote:

 > On Fri, 13 Aug 2004 17:05:48 +0100 Dylan Parry
 > <usenet RemoveThis @dylanparry.com> broke off from drinking a cup of tea at to
 > write:
 >
  >> it looks bloody ugly should one
  >> ever have to look at the outputted HTML for debugging purposes Sad
 >
 > Aaaaaaaaaaaaagh!
 >
 > Don't they teach English at school anymore?

Of course not. Dylan's Welsh, remember?

Grey<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
user233

External


Since: Sep 26, 2003
Posts: 261



(Msg. 8) Posted: Fri Aug 13, 2004 9:16 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dylan Parry wrote:
 > Hey folks,
 >
 > I figured I'd try and get a few more semi-on-topic threads going Wink

Damn you! Just when we had them all but eliminated!


 > is there any way of applying some sort of pretty printing
  > to the code so it's not so ugly?

I usually just use \n to make sure every line of 'generated' HTML is on
its own line.


Matthias<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 9) Posted: Fri Aug 13, 2004 9:16 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Engaging mouth before brain, Matthias Gutfeldt wrote:

  >> I figured I'd try and get a few more semi-on-topic threads going Wink
 >
 > Damn you! Just when we had them all but eliminated!

Sorry Sad

  >> is there any way of applying some sort of pretty printing
  >> to the code so it's not so ugly?
 >
 > I usually just use \n to make sure every line of 'generated' HTML is on
 > its own line.

That's what I use at the moment, but it kinda breaks all the nice
indentation that the rest of the code follow.

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references

Listening to: Mike Oldfield - The Time Has Come<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet200408

External


Since: Aug 02, 2004
Posts: 145



(Msg. 10) Posted: Fri Aug 13, 2004 9:17 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dylan Parry wrote:

 > Engaging mouth before brain, GreyWyvern wrote:
 >
<font color=green>  >> Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>
 >
 > Unfortunately not. Shared hosting etc. I could ask the host if they would
 > be willing to, but it's probably more hassle than it's worth Smile

What about piping your buffered HTML through ~/bin/tidy?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ <a style='text-decoration: underline;' href="http://tobyinkster.co.uk/contact" target="_blank">http://tobyinkster.co.uk/contact</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
comments

External


Since: Sep 14, 2004
Posts: 1625



(Msg. 11) Posted: Fri Aug 13, 2004 9:18 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 13 Aug 2004 17:28:06 +0100 Dylan Parry
<usenet.TakeThisOut@dylanparry.com> broke off from drinking a cup of tea at to
write:

 >Engaging mouth before brain, GreyWyvern wrote:
 >
<font color=green>  >> Is installing libtidy an option? <a style='text-decoration: underline;' href="http://www.php.net/tidy</font" target="_blank">http://www.php.net/tidy</font</a>>
 >
 >Unfortunately not. Shared hosting etc. I could ask the host if they would
 >be willing to, but it's probably more hassle than it's worth Smile
 >

So what you're saying is that you need something so standard its
already installed on the shared hosting, and which will allow
PRACTICAL EXTRACTION of data and REPORTING of it in hypertext markup
LANGUAGE?

The clues are there, as we go through the keyhole....

<BG>

Matt<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 12) Posted: Fri Aug 13, 2004 9:22 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Engaging mouth before brain, Matt Probert wrote:

 > Don't they teach English at school anymore? "outputted" what sort of
 > word is that supposed to be?

<a style='text-decoration: underline;' href="http://dictionary.reference.com/search?q=outputted" target="_blank">http://dictionary.reference.com/search?q=outputted</a>

Also when I was typing the OP my spell checker didn't flag the word and
thus I cared not. So nah to you Razz

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references

Listening to: Steve Howe's Remedy - Sand Devil<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
user233

External


Since: Sep 26, 2003
Posts: 261



(Msg. 13) Posted: Fri Aug 13, 2004 9:23 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dylan Parry wrote:
 > Engaging mouth before brain, Matthias Gutfeldt wrote:
 >
 >
   >>>I figured I'd try and get a few more semi-on-topic threads going Wink
  >>
  >>Damn you! Just when we had them all but eliminated!
 >
 >
 > Sorry Sad

OK, all is forgiven. You can come home now.


   >>>is there any way of applying some sort of pretty printing
   >>>to the code so it's not so ugly?
  >>
  >>I usually just use \n to make sure every line of 'generated' HTML is on
  >>its own line.
 >
 >
 > That's what I use at the moment, but it kinda breaks all the nice
 > indentation that the rest of the code follow.

Well, how about \t ? Or use Tidy like "oeb" mentioned.


Matthias<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
usenet

External


Since: Sep 14, 2004
Posts: 1119



(Msg. 14) Posted: Fri Aug 13, 2004 9:24 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Engaging mouth before brain, Matt Probert wrote:

 > So what you're saying is that you need something so standard its
 > already installed on the shared hosting

No, what I was asking was is there a way that one can do this using PHP. I
should have added that I didn't want to use anything but PHP, ie. only any
functions that are already part of PHP.

--
Dylan Parry
<a style='text-decoration: underline;' href="http://webpageworkshop.co.uk" target="_blank">http://webpageworkshop.co.uk</a> - FREE Web tutorials and references

Listening to: Steve Howe's Remedy - Sand Devil<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
spamblocked

External


Since: Sep 14, 2004
Posts: 588



(Msg. 15) Posted: Fri Aug 13, 2004 9:27 pm
Post subject: Re: Pretty print with PHP? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dylan Parry wrote:

 > Hey folks,
 >
 > I figured I'd try and get a few more semi-on-topic threads going Wink

You're just sick.

 > Okay. I have a couple of sites where the entire contents of most pages
 > are dynamically generated from a database using PHP. Now although they
 > are syntactically correct in their markup, it looks bloody ugly should
 > one ever have to look at the outputted HTML for debugging purposes Sad

Why would you ever need that in production code?

 > I know that you can use a buffer in PHP and not have any of the code
 > output until you are ready, but is there any way of applying some sort
 > of pretty printing to the code so it's not so ugly perhaps using a
 > buffer or a simpler process?
 >

It's a waste of valuable resources.

--
William Tasso
Recommended reading ...
<a style='text-decoration: underline;' href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a>
<a style='text-decoration: underline;' href="http://www.aww-faq.org/" target="_blank">http://www.aww-faq.org/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Pretty print with PHP? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Google Print - Anyone seen this? http://print.google.com/print/faq.html Pretty cool. I especially like: http://print.google.com/ -- Toby A Inkster BSc (Hons) ARCS Contact Me ~ http://tobyinkster.co.uk/contact

How to print www site ? - Hallo, I am looking for aplication able to print full HTML service, starting from main page and including all available subpages ( links ). It should act exactly like teleport, but should print pages instead of collecting them on disk. I would like to...

print on printer via the webserver? - I'm working on an information display setup for a search and rescue command center... trying to move completely away from dry-erase boards and move everything onto a LAN accessible via cat5 and 802.11(b and g when it's finalized). basically, the..

Web Page "Print Page" Button that works - I need to create a web page that has a "Print Page" button or link at the bottom that works. Could someone give me the code to get this to work. Thanks for the helping hand. Tha RagMan

Form output intended to print - I am developing an application where the end result will be that the user print off the resulting output. I can create this so that it outputs a) HTML formatted with CSS, b) M$ Word Document, or c) PDF Which format do you think would be best, and why? -...
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]