SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist Caesar's Avatar
    Join Date
    May 2000
    Location
    On some harddisk
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let's say that I have a webtrendslive tracking code stored in a .inc file located at my root directory http://www.abc.com

    If I wish to track my VBulletin traffic using the footer template, how do I do the include function for PHP to include the .inc located at http://www.abc.com/file.inc assuming my forum is located at http://www.abc.com/forum/.

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the Control Panel, under the Forums header, click on "Modify" - then click "edit" next to any one of the forums.

    Each forum page like that has a radio button asking if you want to parse the header for PHP code (ditto for the footer) - checking these to yes on all forums in use should do the trick - give it a try and let us know how it goes.

    If you want this to be sitewide, click on "Change Options" and then click on "Styles Options" - there should be a radio button there to have the aforementioned parsing apply to all forums.

    Hope that helps!

  3. #3
    SitePoint Evangelist Caesar's Avatar
    Join Date
    May 2000
    Location
    On some harddisk
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, now that I've changed the option to parse the footer for PHP code, I met up with some parsing error when trying to load the page. I suspect something wrong with my PHP codes.

    Let's just say that the below is the footer template:

    ----------------------
    -----------------------
    <?php
    $file = ("http://www.abc.com/abc.inc");
    include("$file");
    ?>
    ----------------------
    ----------------------

    That is what I think I did. Is it correct? Can someone help me cure my codes. Thanks!

  4. #4
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually it should be like this:

    Code:
    <?php
    $file = "http://www.abc.com/abc.inc";
    include("$file");
    ?>
    But this is better:

    Code:
    <?php
    include("http://www.abc.com/abc.inc");
    ?>

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could also try:
    PHP Code:
    <?
    include("/home/username/public_html/abc.inc");
    ?>
    Pete


Bookmarks

Posting Permissions

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