Using the 'Include' function

Discussion in 'PHP' started by iBold, Feb 9, 2006.

  1. #1
    I have 2 domain names. I would like one of those domain names to run all of the ads for both domain names. So I got a fancy script and the like to run my adverts, and it looks perfect on the domain where I installed the script:
    http://ibold.net/sbbmain.php


    But when I try to include it on my second site (www.stopbeingbored.com) using a php include:
    
    <?php
    include("http://www.ibold.net/sbbmain.php");
    ?>
    
    Code (markup):
    I get this mess of php errors:
    Is there a way to correct this? Thanks!
     
    iBold, Feb 9, 2006 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    noppid, Feb 9, 2006 IP
  3. iBold

    iBold Peon

    Messages:
    1,055
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If I put both of them on the same hosting (I have a virtual server) would that eliminate the proglem?
     
    iBold, Feb 9, 2006 IP
  4. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Only if you reconfigure PHP using URLS. If both sites are on the same server, try a literal path. ie. /home/username/file.php
     
    noppid, Feb 9, 2006 IP
  5. arnek

    arnek Active Member

    Messages:
    134
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    this can be done, some applications use .php image locations for dynamic images...
     
    arnek, Feb 9, 2006 IP
  6. ServerUnion

    ServerUnion Peon

    Messages:
    3,611
    Likes Received:
    296
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I use this on a few sites. Ask the admin or host if there are security setting they have to limit this. They may open it up for you.
     
    ServerUnion, Feb 9, 2006 IP
  7. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #7
    He is the admin and host...VPS
     
    noppid, Feb 9, 2006 IP
  8. iBold

    iBold Peon

    Messages:
    1,055
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Only on the one site (stopbeingbored, where I am trying to load the ads). The other is with startlogic (ibold, where I am trying to run the script from), where I am not the admin at all. Just trying to save bandwidth on the larger site by doing this.
     
    iBold, Feb 9, 2006 IP
  9. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #9
    You're not saving bandwith with this idea. In fact, you may increase it. :)
     
    noppid, Feb 9, 2006 IP
  10. iBold

    iBold Peon

    Messages:
    1,055
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If one site is pulling ads off another site, isn't it using up more of the other sites bandwidth? It made sense in my head..or does that include function actually act by pulling it off the other server then serving it up as its own? I always thought of it like an iFrame..but what I know about PHP could fit in my little finger..

    The system was also supposed to let advertisers 'bid' to advertise on my pages, and I figured it would be easier if I could let them bid on all of my advertising space instead of just one sites advertising space (and hopefully more profitable for me), and thus one installation made the most sense.
     
    iBold, Feb 9, 2006 IP