Problem with ad code (includes?)

Status
Not open for further replies.

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
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!
 

YamiKaitou

Member
Messages
636
Reaction score
0
Points
16
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.
 

Cynical

Active Member
Messages
3,492
Reaction score
0
Points
36
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.
 

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
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.
 

YamiKaitou

Member
Messages
636
Reaction score
0
Points
16
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.
 

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
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)?
 

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
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:
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
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
 

Salvatos

Member
Prime Account
Messages
562
Reaction score
1
Points
18
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! :biggrin:
P.S. I suggest adding this to a FAQ or something, in case the problem is on all accounts of the sustained server...
 

YamiKaitou

Member
Messages
636
Reaction score
0
Points
16
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
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
Lol, glad i could have been of assistance for once in my life :).
 
Status
Not open for further replies.
Top