以 http://www.gocar.idv.tw/phpbb3/viewforum.php?f=1 網址為例
1 2 3 4 5 |
$_SERVER['HTTP_HOST'] : www.gocar.idv.tw $_SERVER['REQUEST_URI'] :/phpbb3/viewforum.php?f=1 $_SERVER['PHP_SELF'] : /phpbb3/viewforum.php $_SERVER[QUERY_STRING] : f=1 $_REQUEST['f']:1 或是更準確的 $_GET['f'] |
如果今天有個連結是
http://xxxxxx.xxx.xxx/1.php?asdfasdfa=a333322222&cde=TEST
那麼
1 |
$temparray=explode("=",$_SERVER[QUERY_STRING]); |
如果只有一個input name,用等號切開就好..
1 |
$temparray=explode("=",$_SERVER[QUERY_STRING]); |
$temparray[0]就是input name
$temparray[1]就是input name的值