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.

php include

Discussion in 'PHP' started by wendydettmer, Mar 31, 2005.

  1. #1
    I'm a total newbie when it comes to php, but i want to add php includes on my site. Does anyone know any good references for this? They will be basic includes, header, footer and sidebar.

    Thanks in advance
     
    wendydettmer, Mar 31, 2005 IP
  2. l234244

    l234244 Peon

    Messages:
    1,225
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #2
    l234244, Mar 31, 2005 IP
  3. Epica

    Epica Well-Known Member

    Messages:
    1,007
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    170
    #3
    Yeah - I spent 3hrs trying to test my php tags for syntax errors on my first attempt at includes...

    ...yeah...I was tying to get PHP included tages to work in an HTML page.

    Some days you feel like 'Man, I'm REALLY getting this!' other days...you just want to bury your head in the mud ;)
     
    Epica, Mar 31, 2005 IP
  4. l234244

    l234244 Peon

    Messages:
    1,225
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I had the same problem AzAkers, as soon as I followed the example in the link above I understood what I was doing wrong.
     
    l234244, Mar 31, 2005 IP
  5. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #5
    The example cited shows how to create a php file with html includes using the php include function.

    The question is, how do I add php commands to my html pages if I'm understanding correctly?

    If so you can add one line to your .htaccess file for your apache driven site and have php parsed in html files.

    AddType application/x-httpd-php .php .html

    With that, you can have php blocks parsed in your html files so long as ya put the php code in php tags.

    
    <?php
    include("somefile");
    ?>
    
    PHP:
     
    noppid, Mar 31, 2005 IP
    wendydettmer likes this.