e.g....
my Article...
Code: Select all
{PHP:include\inc_ext\myFile.php?foo="Dir/SubDir/"}
Code: Select all
$foo = $_GET['foo']; ...
Code: Select all
{PHP:include\inc_ext\myFile.php?foo="Dir/SubDir/"}
Code: Select all
$foo = $_GET['foo']; ...
hopes this helpsi change some code in front.func.inc.php. so i can transfer some value to my ext php.
Code:
function include_ext_php($inc_file) {
// includes an external PHP script file and returns
// the result as string from buffered include content
$ext_php_content = "";
ob_start();
$command=strpos($inc_file,"?");
if ($command>0)
{
parse_str(substr($inc_file,$command+1));
$inc_file=substr($inc_file,0,$command);
}
include $inc_file;
$ext_php_content = ob_get_contents();
ob_end_clean();
return $ext_php_content;
}
i can use it like that
Code:
{PHP:showmoviecat.php?cat=1}
Code: Select all
$command=strpos($inc_file,"?");// LOOK FOR A '?'
if ($command>0)//IF THERE IS A '?' do....
{
parse_str(substr($inc_file,$command+1));
$inc_file=substr($inc_file,0,$command);//GET ALL BEFORE THE '?'
}
Code: Select all
function include_ext_php($inc_file) {
// includes an external PHP script file and returns
// the result as string from buffered include content
$ext_php_content = '';
$command = strpos($inc_file, '?');
if ($command !== false) {
parse_str(substr($inc_file,$command+1));
$inc_file_short = substr($inc_file, 0, $command);
}
if(is_file($inc_file_short)) {
$this_path = str_replace("\\", '/', dirname(realpath($inc_file_short)));
$this_path = preg_replace('/\/$/', '', $this_path);
$root_path = str_replace("\\", '/', PHPWCMS_ROOT);
$root_path = preg_replace('/\/$/', '', $root_path);
if(strpos($this_path, $root_path) === 0) {
ob_start();
include $inc_file_short;
$ext_php_content = ob_get_contents();
ob_end_clean();
}
}
return $ext_php_content;
}
Code: Select all
function include_ext_php($inc_file) {
// includes an external PHP script file and returns
// the result as string from buffered include content
$ext_php_content = '';
//check if this is a local file
if(is_file($inc_file)) {
$this_path = str_replace("\\", '/', dirname(realpath($inc_file)));
$this_path = preg_replace('/\/$/', '', $this_path);
$root_path = str_replace("\\", '/', PHPWCMS_ROOT);
$root_path = preg_replace('/\/$/', '', $root_path);
if(strpos($this_path, $root_path) === 0) {
ob_start();
include $inc_file;
$ext_php_content = ob_get_contents();
ob_end_clean();
}
}
return $ext_php_content;
}