PDA

View Full Version : Plugin Error


Thr33
03-02-2017, 02:08 AM
I am trying to register a variable and use data from a php file to display

hook location: init_startup
forumhome > {vb:raw shoutstats}
vB_Template::preRegister('footer',array('shoutstat s' => $shoutstats));
ob_start();
require_once('http://literecords.com/user/sc.php');
$shoutstats = ob_get_contents();
ob_end_clean();

Unfortunately with this code i get this error

PHP Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in ..../includes/init.php(351) : eval()'d code on line 4

I have disabled the plugin right now but i would like to get this to work.

Ive also tried
include('http://literecords.com/user/sc.php');
instead of require_once & in hook location : global_bootstrap_init_start

PHP Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in ..../includes/class_bootstrap.php(103) : eval()'d code on line 2

Dave
03-02-2017, 01:08 PM
You should not use the include/require functions to get data from a remote file.
If you want to get data from a remote file, use file_get_contents:
$shoutstats = file_get_contents('http://literecords.com/user/sc.php');
This will fetch the output of the PHP file.

If the file is on your local server, use:
require("user/sc.php");
This will execute the PHP code.