Page 1 of 1

single php-file page with include???

Posted: Mon Nov 18, 2002 5:36 am
by bergie
Hi,

at the moment im developing a litte page just for fun, it looks like this:

-there is 1 single phpfile (index.php)
-the secion ist selected by giving a variable named content
(f.e.: index.php?content=news)
- i have a funtion drawcontent() which checks what the var "$content" is an displays the content by including a file
f.e.: if ($content == "news")
include ("news.php")

ok, my question? is it a stupid way to handle? (be polite *g*). is it bad vor the webserver etc? is there another more simple way?

p.s.: i dont want frames and i have seen there ARE a few pages handling there content with only one file

thanks a lot!

Posted: Mon Nov 18, 2002 5:47 am
by twigletmac
If you like the way that this works for you then there really isn't anything wrong with the approach - and as you've noticed it's a fairly common way of doing dynamic sites.

This may be of interest to you:
viewtopic.php?t=3262&highlight=include+header+footer

Mac

Posted: Mon Nov 18, 2002 9:21 am
by bergie
as i said before: thx a lot
-> close