Hi there,

On Sunday, September 22, 2002 12:20 PM
Subject: Re: [PHP] Best Practice
Peter J. Schoenster wrote:
<snip>
> On 21 Sep 2002 at 12:51, Ashley M. Kirchner wrote:
>
> >
> >     I'm working on converting several static (price) pages on our site
> >     into dynamic pages, with the data stored in an MySQL database and
> >     PHP to pull the data out, with CSS to build the page and present it.
>
> I don't see how CSS would build anything, I guess it's just
> terminology.
>
</snip>

Actually, in a sense, CSS can "build" a page--esp. if "build" means how data
are to be presented (formatted) by the browser. Remember, with CSS you can
hide and unhide elements?

For the original question...

> >      At the same time, I would also like to have a 'printer friendly'
> >     link on each page that visitors can click on and get the same page
> >     re-rendered for easy printing.  What's the best way to get the data
> >     converted from one form to another?  Should I be querying the
> >     database again to get the same data to reformat?  Should I store the
> >     data in sessions and reformat based on the CSS?  I would think
> >     having to query twice for the same thing would be a degradation in
> >     performance, right?  So what's the best practice?
>

The best practice, IMHO, is the one implemented here:

  http://www.alistapart.com/

Try the page with your standard-compliant browser (like N7) and with a
(crappy) browser like N4 and see the difference. You can "dissect" the site
and find out how they did it. Or, you can read articles like this:

  http://www.alistapart.com/stories/netscape/

And one for "easy printing":

  http://www.alistapart.com/stories/goingtoprint/

- E

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to