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.

Need help on php include();

Discussion in 'PHP' started by Tuning, Mar 20, 2005.

  1. #1
    Hi folks,

    I'm wandering how include(); can be used with absolute url.

    For example, I need to make avaialble a footer.php file available over every php page created on my site.

    Can anyone tell me the correct syntax for include() and absolute url ? :)

    Best Regards,
    Tuning
     
    Tuning, Mar 20, 2005 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    noppid, Mar 20, 2005 IP
  3. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #3
    Thanks nopidd.

    How would I find out the exact path ?

    Regards,
    Tuning
     
    Tuning, Mar 20, 2005 IP
  4. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #4
    setup a php info page..
    phpinfo.php
    <?php
    phpinfo();
    ?>

    You will find the full path on the page. It is normally /home/username/public_html/yourcreateddir/file.php

    hope that helps.
     
    Juls, Mar 20, 2005 IP
  5. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #5
    What he said. :)
     
    noppid, Mar 20, 2005 IP
  6. Tuning

    Tuning Well-Known Member

    Messages:
    1,005
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    138
    #6
    Thanks Juls!
     
    Tuning, Mar 20, 2005 IP
  7. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #7
    no worries, trying to give back to the dp community.... i have received a lot of help from here. ;-)

    hope things work out for you.
     
    Juls, Mar 20, 2005 IP
  8. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Another way to find out the path of the directory that the PHP script is currently in, you would probably use this to test, is:

    <?php echo curdir(); ?>

    Unless you have changed directories in the executing script then this should be the directory of the executing script.
     
    danpadams, Mar 21, 2005 IP