Log in

View Full Version : External header issue


zorag
12-20-2007, 01:15 PM
Hello Everyone

I'm having a problem pulling in a PHP file into the VB header, I'm using the instructions as set out in the VB manual for external PHP files, but it's giving this error in the header:

Warning: include(home3/ventscom/public_html/index.php?t=index_menu) [function.include]: failed to open stream: No such file or directory in /global.php(360) : eval()'d code on line 2

The plugin code entered in the plugin manager is:

ob_start();
include('home3/ventscom/public_html/index.php?t=index_menu');
$includedphp = ob_get_contents();
ob_end_clean();

The index.php file is definitely located in the public_html directory and I've double checked the path in PHP info, I've tried various path permutations without luck.

Any suggestions?

Thanks in advance.

zorag
12-26-2007, 08:51 PM
Still can't get this to work but I'm thinking that it may be because it's an executable PHP with an action "index.php?t=index_menu", rather than the VB ob_start call above just pulling in the content of the index.php file?

Any suggestions?

Thanks

Opserty
12-26-2007, 10:18 PM
From php.net: (http://php.net/include)

// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';

// Works.
include 'http://www.example.com/file.php?foo=1&bar=2';


So in your case it would be:

ob_start();
include('http://www.yourdomain.com/index.php?t=index_menu');
$includedphp = ob_get_contents();
ob_end_clean();

(Where obviously www.yourdomain.com is the actual domain name of your site.)

Its a bit of a guess but it's worth a try.

zorag
12-30-2007, 01:35 PM
Thanks Opserty

Still no luck, I'm getting this error when using a URL:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /global.php(360) : eval()'d code on line 2

"no suitable wrapper could be found"

I think I may have found the issue here, the index.php file I'm calling has an action "index.php?t=index_menu" and so it's not an actual "correct" path name. It's also overriding VB, this is a Smarty PHP call using Jamroom.net software which will not mix well within the VB framework.

Do you know of any another way I can pull in this call into the header section of VB, or do I have to manually design one?

Thanks

Dismounted
12-31-2007, 02:32 AM
The issue here is that your server has blocked accessing URLs, so your include won't work if it accesses a URL.