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!
single php-file page with include???
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
This may be of interest to you:
viewtopic.php?t=3262&highlight=include+header+footer
Mac