Heim >Backend-Entwicklung >PHP-Tutorial >菜鸟求救:php获取元素ID根据id不同调用不用的文件并解析模板

菜鸟求救:php获取元素ID根据id不同调用不用的文件并解析模板

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 14:17:471140Durchsuche

require_once("admin/include/global.inc.php");
include "admin/include/page.class.php";
if($_GET[q]){
 $help="kepiao";
 $helptitle="我的帮助文件,我自己写的帮助文件";
}
elseif($_GET[r]){
 $help="rule";

}
else{
$help="help";
$helptitle="帮助中心,超级帮助中心";

}

$Smarty->assign("cfg_cmstitle","$helptitle");
$Smarty->display("$help.html");

include "foot.php";

上面是我自己写的,实现不了自己要的效果啊!这样的写法url路径是help?q=$$$$、help?r=$$$$可以访问,但不是我要的url效果,我想达到help?u=q、help?u=r可以访问的方式。请问怎么能做到呢?




回复讨论(解决方案)

<?phprequire_once("admin/include/global.inc.php");include "admin/include/page.class.php";if($_GET['u'] && $_GET['u']=='q'){ $help="kepiao"; $helptitle="我的帮助文件,我自己写的帮助文件";}elseif($_GET['u'] && $_GET['u']=='r'){ $help="rule";}else{$help="help";$helptitle="帮助中心,超级帮助中心";}$Smarty->assign("cfg_cmstitle","$helptitle");$Smarty->display("$help.html");include "foot.php";

多谢@!

不可以 以后也可以多交流 ^^

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:求一段php取值代码Nächster Artikel:php读xml巨慢(大数据量)