The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Including a php file
Hello, I include a php file via plugin using this code:
Code:
ob_start(); include('http://www.site.com/test/includes/dbar.php'); $includedphp = ob_get_contents(); ob_end_clean(); Code:
$includedphp Quote:
|
#2
|
||||
|
||||
This is not an error with the plugin, but an error with the file you are including. Does it work stand-alone?
|
#3
|
||||
|
||||
It should.. what can I try to do?
|
#4
|
||||
|
||||
Fix the errors in the file... It tells you what and where they are. It looks like you've used an absolute URL as an include. A lot of server configurations prevent this. You should use absolute filesystem references (ie. /home/user/file.php).
|
#5
|
||||
|
||||
This is the content of my test/includes/dbar.php file:
Code:
<!-- Start Dbar --> <div id="dbar"> <span id="dbar_welcomepanel">Welcome to My Site! (<a href="register">Registrati</a> | <a href="login">Entra</a> | <a href="tour">Tour</a>)</span> <strong><a href="#">Mysite.com</a> | <a href="#">Hosting</a> | <a href="#">Blog</a> | <a href="#">Community</a> | <a href="altro" onClick="return dropdownmenu(this, event, popup_altro, '200px')" onMouseout="delayhidemenu()">Altro.. »</a></strong> </div> <!-- ### --> Code:
Warning: Unknown(): open_basedir restriction in effect. File(/var/www/virtual/mysite.com/htdocs/test/includes/dbar.php) is not within the allowed path(s): (/var/www/virtual/community.mysite.com/:/var/www/virtual/community.mysite.com/htdocs/:/usr/share/php/:/tmp/) in [path]/global.php(384) : eval()'d code on line 3 Warning: Unknown(/var/www/virtual/mysite.com/htdocs/test/includes/dbar.php): failed to open stream: Operation not permitted in [path]/global.php(384) : eval()'d code on line 3 Warning: (null)(): Failed opening '/var/www/virtual/mysite.com/htdocs/test/includes/dbar.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in [path]/global.php(384) : eval()'d code on line 3 |
#6
|
||||
|
||||
Do you have the file inside your web folder, open_basedir suggests you don't have it in a folder your own/associated with your site.
|
#7
|
||||
|
||||
That's on the same server my site is.
|
#8
|
||||
|
||||
not just server, but folder
for example including the following on username1's site will work. /home/username1/public_html/phpinclude.php Including the following on username1's site won't work, as username1 doesn't own/have permission to the file. /home/username2/public_html/phpinclude.php Probably not the best explanation, but its the best i've got |
#9
|
||||
|
||||
Yup, I understand. But I'm sure that's the same site folder.
For security I have also retrieved the directory path using this: PHP Code:
|
#10
|
||||
|
||||
Probably better using cURL since you only want the content of the page, and it'll allow you to use URLs to specify the location of the file assuming your PHP setup allows for it.
Code:
$curl_handle = curl_init(); curl_setopt($curl_handle,CURLOPT_URL, 'http://www.siet.com/test/includes/dbar.php'); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER, 1); $includedphp = curl_exec($curl_handle); curl_close($curl_handle); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|