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.

New to PHP, Include() problem

Discussion in 'PHP' started by randymci, Feb 24, 2009.

  1. #1
    I am new to PHP. In another thread it was mentioned that I could use PHP as a sidebar, footer etc and used in many HTML files. So I have tried a test.

    I have created the following 2 files

    sidebar.php
    footer.php

    I have tried to call them in an HTML using

    <?php include('sidebar.php'); ?>
    <?php include('footer.php'); ?>

    Nothing happens. If I goto the php page alone if show OK

    Here is the actual files

    http://.www.airtekltd.com/test1.htm
    http://www.airtekltd.com/sidebar.php
    http://www.airtekltd.com/footer.php

    Any help would be most appreciated.
     
    randymci, Feb 24, 2009 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    It needs to be in a PHP-parsed document.

    Easiest way would change the file extension on test1 to test1.php
     
    Danltn, Feb 24, 2009 IP
  3. randymci

    randymci Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Great thank you,

    Now what would the hard way be?

    In the end I will have around 400 pages to open and change all the links on the page from htm to php. Also what would changing the extension on 400 pages do to my google and other listings? Changing the file names is not a problem but we are talking days and days of work to change all the contents. Is there an easier way to do this? Or should I take this to a new thread?
     
    randymci, Feb 24, 2009 IP
  4. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #4
    AddType application/x-httpd-php .htm
    Code (markup):
    To .htaccess.
     
    Danltn, Feb 24, 2009 IP
  5. randymci

    randymci Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Great both worked like a charm! :D

    Thanks
     
    randymci, Feb 24, 2009 IP