[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: About PHP3



On Tue, May 18, 1999 at 05:39:21PM -0400, Paul Tiseo wrote:
> Which begs the question: should we start making an outline of where and
> how PHP3 might benefit us? That way, we'll be ready when the Great
> Information Influx hits us...anytime real soon now. ;)
Make the entire site dynamic where possible.

* News items, articles, editorials, game projects can all go in MySQL
database and get queried.

* Make one PHP page with the site lay-out and have a query as argument for
the content in it. This way you can update footers etc but most importantly
the entire lay-out by editing one page.

I myself use:

if ($q) { if (file_exists("inc/${q}.inc")) { include("inc/${q}.inc"); } else
{ include("inc/404.inc"); } }
else { include("inc/index.inc"); }

Which means: if the page is called in a way like page.php3?q=friendspage,
show the friendspage.inc if it exists or include the 404 message. If there's
no query print the index page.

Added benefit is that the files where you put the content has minumum HTML,
because all HTML for the lay-out comes from the one php page and is not in
the .inc files.

This works remarkably well, at least for me it does. I haven't tried out
MySQL statements yet, but I will soon, and also I will add cookies to my
personal site. (a personal site with PHP, cookies and a database? why!? - for
the experience and fun)

Grtz, Rob
-- 
Rob Kaper | mail: cap@capsi.com + cap@capsi.net + cap@capsi.cx
          | web: http://capsi.com/ + http://capsi.cx/ - icq: 707085
          | "Got up early (as in before noon). A most confusing experience
          |  when the sun is coming up not going down." -- Alan Cox