先說實現方法
inj
<?php
set_time_limit(
$id=$_GET["id"];
$id=str_replace(" "
$id=str_replace("="
$url="";
$ch=curl_init();
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
$output=curl_exec($ch);
curl_close($ch);
print_r($output);
?>
用wamp搭建一個服務器
=============================
PHP偽靜態實現方法一(利用Apache 服務器的功能)
RewriteEngine on
RewriteRule ([a
([a
$
$
比如說
真實的URL如下
action = page
id =
============================
PHP偽靜態實現方法二(編碼實現)
$Php
echo $Php
例子
$Php
/*
內層的strrchr出來
外層的strrchr出來
內層的str_replace出來
外層的str_replace出來
*/
$Php
/*把str變成以@為界限劃分的數組
foreach($Php
{
$Php
/* id =>
$_GET[$Php
}
============================
PHP偽靜態實現方法三(編碼實現)
例子: localhost/php
$filename = basename($_SERVER["SCRIPT_NAME"]);
echo $_SERVER["SCRIPT_NAME"];
echo $filename;
if(strtolower($filename) ==
if(!empty($_GET[id])){
$id=intval($_GET[id]);
echo $id;
$action = intval($_GET[action]);
echo $action;
}else{
$nav=$_SERVER["REQUEST_URI"];
$script=$_SERVER["SRCIPT_NAME"];
//這句話應該是把URL前面那段給搞掉
$nav=ereg_replace("$script"
echo $nav;
$vars = explode("/"
print_r($vars);
$id=intval($vars[
$action=intval($vars[
}
echo $id
}
============================
PHP偽靜態實現方法四(編碼實現)
function mod_rewrite(){
global $_GET;
$nav = $_SERVER["REQUEST_URI"];
$script_name = $_SERVER["SCRIPT_NAME"]
$nav=substr(ereg_replace("$script_name")
$nav=preg_replace("/^
$vars=explode("/"
print_r($vars);
for($i=
{
$_GET[$vars[$i]] = $vars[$i+
}
return $_GET;
}
============================
PHP偽靜態實現方法五(編碼實現)
例子
if(preg_match(“//(d+)
$gid =intval($arr_path[
$sid =intval($arr_path[
$softid =intval($arr_path[
}
else
echo "Path:Error!";
總結下
(
(
From:http://tw.wingwit.com/Article/program/PHP/201311/21059.html