Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Problem with ad code (includes?)

  1. #1
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Question Problem with ad code (includes?)

    Salvatos
    salvatos.x10hosting.com
    Advanced Plan

    My account was lost in the last server transfer and I am now working on my site on the sustained server. Everything seems to be fine, except for one thing: includes do not seem to work properly. My main page is made of multiple frames (includes) that work fine, but I can't get the php ad code to work. It shows the following error:

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/salvatos/public_html/rpg/footer.php on line 10

    Warning: include(http://staff.x10hosting.com/adCode.php?ad=advanced) [function.include]: failed to open stream: no suitable wrapper could be found in /home/salvatos/public_html/rpg/footer.php on line 10

    Warning: include() [function.include]: Failed opening 'http://staff.x10hosting.com/adCode.php?ad=advanced' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/salvatos/public_html/rpg/footer.php on line 10
    I had the same problem on another part of my domain, made mostly of html (although I gave it php extensions in order to add the ad code), so it should not be a problem specific to footer.php. It looks like there is a setting in the server configuration that prevents me from activating the ad, and probably other types of includes, which is weird.

    I tried to put the javascript code everywhere, and it works fine, but I fear I might have forgotten some pages and I would not want to be suspended because of that =/
    Is there some configuration I have to change in the cPanel or is it a problem with the server, a mistake in my code...?

    Thanks for your help!

  2. #2
    YamiKaitou's Avatar
    YamiKaitou is offline x10 Elder YamiKaitou is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    636

    Re: Problem with ad code (includes?)

    It would seem that includes of remote files are unable to be viewed, but includes of files on your account still can be viewed. What I did was just paste the Javascript into a html file named "x10ads.html" and then I just put "include('x10ads.html');" whereever I want the ads.

  3. #3
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,744

    Re: Problem with ad code (includes?)

    Try using the PHP include function to include a local file. For example, just make a test1.php and a test2.php page, then put <?PHP include('test2.php'); ?> in the first file and Hello World in the second, and tell us what happens.
    Seven: This rule is so underrated, keep your family and business completely separated.

  4. #4
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Re: Problem with ad code (includes?)

    It shows Hello World as I guessed, as for the frames included in my site: they all show perfectly. So as YamiKaitou said, it would be a problem with files hosted on other domains.

  5. #5
    YamiKaitou's Avatar
    YamiKaitou is offline x10 Elder YamiKaitou is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    636

    Re: Problem with ad code (includes?)

    So, you can use the Javascript for it or you can use what I use (as stated in my last post) if you really want to use PHP.

  6. #6
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Re: Problem with ad code (includes?)

    Hm yea but what if, later, I have other includes to add that point to other sites or whatever? Isn't there a way to solve this problem instead of working around it? (Anyway, thanks for the idea, that will help ;) )

    Oh and what is a wrapper exactly (second sentence of the error report in my first post)?

  7. #7
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Re: Problem with ad code (includes?)

    UP
    I found another page where an include doesn't work properly but since it is not my code I don't have much details about it. I'm changing that page and others soon, but I'm pretty sure that other include problems will show up eventually...Isn't there anything I can do to make the includes work properly? :dunno:

  8. #8
    Micro is offline Retired staff (11-12-2008) Micro is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    West Midlands
    Posts
    1,301

    Re: Problem with ad code (includes?)

    Try putting this into a file called php.ini in your root dir (www -- you will need to create this),
    Code:
    [php]
    
    ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
    allow_url_fopen = On
    
    ; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
    allow_url_include = On
    Micro

  9. #9
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Thumbs up Re: Problem with ad code (includes?)

    Well I copied the exact code in php.ini, in /www and it didn't work. Since my site is in root/rpg/page.php, I tried putting the php.ini file in /rpg and...IT WORKED!

    Thanks a lot, that's going to your reputation!
    P.S. I suggest adding this to a FAQ or something, in case the problem is on all accounts of the sustained server...

  10. #10
    YamiKaitou's Avatar
    YamiKaitou is offline x10 Elder YamiKaitou is an unknown quantity at this point
    Join Date
    Oct 2006
    Posts
    636

    Re: Problem with ad code (includes?)

    I believe that the problem is with all accounts on both servers.

    Now I need to try that Micro, cause there is a page that I wanted to include but never could because of this error

Closed Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 03:12 PM
  2. ad code problem
    By subodh in forum Free Hosting
    Replies: 2
    Last Post: 11-19-2006, 12:55 AM
  3. Requiring your help with a bit of a code problem
    By Zenax in forum Graphics & Webdesign
    Replies: 10
    Last Post: 07-31-2006, 06:38 PM
  4. Ad code problem!
    By Akkarin in forum Free Hosting
    Replies: 8
    Last Post: 08-29-2005, 11:39 AM
  5. corporate ads code problem
    By ronghui in forum Free Hosting
    Replies: 5
    Last Post: 07-29-2005, 12:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers