View Full Version : basic idea behind using include function in news display

04-07-2003, 02:59 AM
I'm using the code below to automatically insert the text of the article on the same page as news.php3. The text is stored in separate files namely 'jan02' and 'jan23'. These files have no extentions and work fine when called.

if($id != ""){
include "$id";
echo "<a href='news.php3?id=jan02'>January 02</a>";
echo "<a href='news.php3?id=jan23'>January 23</a>";

I was just wondering is this is the basic idea behind those news posting scripts? Do the scripts automatically create separate files too? If they do, then I would stick with my own code since I don't need the adv features (i.e. archiving, automation). But if they don't, and actually hv a more sufficient way of storing the text, then maybe I'll search for a script.


04-07-2003, 06:41 AM
the most common method is probably to store the news items in a database , but there is nothing wrong with using text files which have advantages themselves , the only disadvantage of using text files is that they are obviously harder to search if you want that facility , though any decent spidering script can search them for you.

If it aint broke , don't fix it ;)

04-07-2003, 02:46 PM