i use {PHP:xxx} tags , it's worked well.
but there are thress questions.
1: my php program can't get the value from phpwcms ,
for example , http://www.mbank.cn/index.php?id=4,0,0,1,0,0&cat=1
I can't get the value of cat. how can i get it.
2:my php code don't know the position , i mean if i both include a same php code in news and download, my php code don't know where he is .
3:i can't use the tag like that . {PHP:demo.php?abc=123&h=23}
How to get the value in my php program
i change some code in front.func.inc.php. so i can transfer some value to my ext php.
i can use it like that
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 = "";
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;
}
Code: Select all
{PHP:showmoviecat.php?cat=1}
What is the idea of ..cat=1? I´m just curious..fatxu wrote:Code: Select all
{PHP:showmoviecat.php?cat=1}
http://www.studmed.dk Portal for doctors and medical students in Denmark
i do more change on the code ,so i can get more value in my ext_php now.
i can get value like this
{PHP:demo.php?t1=3&t2=4}
i have a question .
my ext_php code can get the var's value by URL
for example
http://www.xxxx.com/index.php?id=1,0,0,0,3&cat=3
my code can get id,cat value
but can't get the var's value from cookie.
it's important to my to get the cookie value.
now i use a temporary solution.
i change the index.php's name to main.php,and i create a new index.php
$sid is a var get value from cookie.
now ,my ext_php code can get the cookie value.
but i know ,it's not a good idea.
who can give me more advise.
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 = "";
ob_start();
$command=strpos($inc_file,"?");
if ($command>0)
{
$tmp=substr($inc_file,$command+1);
$tmp=ereg_replace("&","&",$tmp);
parse_str($tmp);
$inc_file=substr($inc_file,0,$command);
}
include $inc_file;
$ext_php_content = ob_get_contents();
ob_end_clean();
return $ext_php_content;
}
{PHP:demo.php?t1=3&t2=4}
i have a question .
my ext_php code can get the var's value by URL
for example
http://www.xxxx.com/index.php?id=1,0,0,0,3&cat=3
my code can get id,cat value
but can't get the var's value from cookie.
it's important to my to get the cookie value.
now i use a temporary solution.
i change the index.php's name to main.php,and i create a new index.php
$sid is a var get value from cookie.
Code: Select all
<?php
$schema = $_SERVER['SERVER_PORT'] == '443' ? 'https' : 'http';
$host = strlen($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:$_SERVER['SERVER_NAME'];
$to="$schema://{$host}/main.php?".$_SERVER['QUERY_STRING']."&sid=$sid";
header("Location: $to");
?>
but i know ,it's not a good idea.
who can give me more advise.