最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php下實(shí)現(xiàn)偽 url 的超簡(jiǎn)單方法[轉(zhuǎn)]

 更新時(shí)間:2007年09月24日 11:41:47   作者:  
就像我的日志中的地址路徑一樣,讓 index.php?action=one&do=two 
變成: ?index/action/one/do/two
復(fù)制代碼 代碼如下:

index.php
--------------
<?php

// PARSING QUERY STRING
$QS=explode("&",$_SERVER['QUERY_STRING']);
$QS=explode('/',$QS[0]);

// IF Modul is Undefined set it to index
if (!$QS[0]) $MODUL='index';
else $MODUL=strtolower($QS[0]);

// WE can make a Variable $_QUERY
// for alternative _GET
for ($i=1;$i<count($QS);$i+=2)

$_QUERY[$NVAR]=$NVAR=$QS[$i];
$$NVAR=$QS[$i+1];
}

// Check the Modul is exists?
if (!file_exists("modul_directory/{ $MODUL }.php"))
$MODUL="index";

#### THIS IS EXAMPLE TO IMPLEMENTATION THE SCRIPT
// Load The Template
include("template.php");
// Load The Module
include("modul_directory/{ $MODUL }.php");
// Load The Footer
include("footer.php");

?>

we can access the modul in URL like this:
=================================

www.example.com/?forum/topic/20
- it mean load the modul forum.php, and set the _QUERY['topic']=20

www.foo.com/?voting/id/54/type/piechart&choice=2
- it mean load the modul voting.php, and set the _QUERY['id']=54 and _QUERY['type']='piechart' and set _GET['choice']=2 

相關(guān)文章

最新評(píng)論

苍溪县| 启东市| 沙雅县| 剑阁县| 东安县| 玉门市| 西林县| 丹凤县| 东乌珠穆沁旗| 辽源市| 佳木斯市| 县级市| 牟定县| 侯马市| 杭锦旗| 万荣县| 普兰店市| 苏尼特右旗| 鄄城县| 沂源县| 胶南市| 石首市| 赤峰市| 萨迦县| 九江市| 衡东县| 阿荣旗| 商洛市| 汶上县| 尉犁县| 剑河县| 临沧市| 顺昌县| 墨玉县| 寿宁县| 南涧| 莲花县| 宕昌县| 德江县| 丰原市| 介休市|