with "php include" I get FILE IS NOT READABLE, but the file IS readable!

andreste

Joined: 2006-06-02
Posts: 123
Posted: Mon, 2010-09-27 15:26

Hello, I need a little help here.
I'm using this code to add a banner rotator to my template

{include_php file='http://www.domain-domain.net/adrotator/728x90-1/ad_rotator.php'}

but I get: "Smarty error: file is not readable".
While if I paste the address in my browser, I DO see the ad banners, so the php file IS indeed readable.

Why can't Gallery see it?

I have tried several versions of the include, but either I don't get anything or I get that error :-(

Stefano

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-09-27 16:13

You can't use http:// to specify the file to include. You need to list the full path on the server

/path/to/include/file

http://www.smarty.net/manual/en/language.function.include.php.php

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
andreste

Joined: 2006-06-02
Posts: 123
Posted: Mon, 2010-09-27 16:23

update:
Now I get this error: The action you attempted is not permitted.

But I read that if I use an absolute path, the system shouldn't find a security violation.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-09-27 16:38

You can try using plain PHP by wrapping that with php tags:

{php}
INSERT PHP CODE HERE
{/php}
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here