1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to Insert Content into Pages PHP

Discussion in 'General Business' started by 1001, Mar 1, 2005.

  1. #1
    I have a giant stack of articles and would like to use them on my web sites but there are too many of them to build pages by hand.

    They are on HTML pages but do not have any of the proper <HEAD><BODY> tags, just formatting for the article and links for the credit (basically they are text files but have the formatting info and h ref tags).

    Is there a simple way for a non-programmer like me to get the ARTICLES in between a header and a footer and create an index/menu for them? If it's too much work by hand it's not worth it, but I wouldn't mind having a site with all that content.

    Of course it'd be nice to automate the whole process. Also what about the titles... hopefully there is a solution so all the pages would NOT have the same TITLES.

    I also have an MYSQL file of all the articles as well but would not know where to begin with that. Maybe that's easier to work with???

    I'd prefer to put the content in via PHP but just am not knowledgeable enough yet to pull it off myself.

    Can anyone help me or steer me in the right direction?

    Thanks,

    Mike
     
    1001, Mar 1, 2005 IP
  2. Corey Bryant

    Corey Bryant Texan at Heart

    Messages:
    1,126
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Almost any CMS (content management system) should help you categorize them actually. Or you can just create the <HEAD><BODY> on a PHP page and then insert the TXT file via a PHP command
    <?php
      include "menu.txt";
    ?>
    Code (markup):
     
    Corey Bryant, Mar 1, 2005 IP
  3. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just like Corey said above is a great way to do it.

    If you already have one long HTML formatted document look at.
    cmSimple.dk

    Basically it works off any HTML page and when it sees an
    These four tags it creates a nice website for you
    H1= Menu Title
    H2 = Sub Menu
    H3= Sub-SubMenu
    H4= Article Title

    From above you can see you will only have a website that is 3 deep maximum.

    It's great because it provides search and menu features
    has an internal editor and you can edit the stylesheet and template to make quick changes.
     
    sadcox66, Mar 1, 2005 IP
  4. 1001

    1001 Peon

    Messages:
    84
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Will check it out - thanks!
     
    1001, Mar 20, 2005 IP
  5. Kevlar

    Kevlar Guest

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You just need to build a template using server side includes. Create files for the header, footer, ect. You can even insert the articles themselves as virtual includes (e.g. in a "body" section). After you have the template set up, all you will have to change is the <title> tag and the file name of the article. Here is a good article on the basics of includes:
    http://www.kabooli.com/articles/web-site-design/server-side-includes.php


     
    Kevlar, Mar 20, 2005 IP