Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    basic idea behind using include function in news display

    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";
    }
    else{
    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.

    Thanks.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    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
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Mar 2003
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •