Loading...

使用PHP取得目前網址方式

Temperature: 0 °C

Mark ChangMark Chang
author_tools


使用PHP取得目前網址方式
使用PHP取得網址相關的方式有下列幾種:

$_SERVER["REQUEST_URI"]取得當前
$_SERVER["HTTP_REFERER"] 取得上一頁連結
$_SERVER['PHP_SELF']不含參數

以下修改,是為了資安。
htmlEntities($_SERVER["PHP_SELF"], ENT_QUOTES, "UTF-8")不含參數
htmlEntities($_SERVER['HTTP_REFERER'], ENT_QUOTES, "UTF-8") 取得上一頁連結
htmlEntities($_SERVER['REQUEST_URI'], ENT_QUOTES, "UTF-8") 取得當前


老了,純粹只是記錄~

https://innstory.com/story-使用PHP取得目前網址方式-1609
PHP

Prev
 PHP–implode_將陣列轉成字串

Next
分享_猴子自拍照爭議落幕了美上訴法院:猴子沒有著作權 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

使用手機將網址分享到 Line時,如何強制使用預設(外部)瀏覽器開啟?

使用手機將網址分享到 Lin...

如標題,當厭惡了每次在line上面分享demo網址給客戶時點選網址就會使用line的瀏覽器開啟。 還...

使用CSS讓整個網頁由彩色變黑白色!

使用CSS讓整個網頁由彩色變...

blackandwhite5 把下面的語法加入網頁的<head>與</head&g...

PHP清空陣列函數

PHP清空陣列函數

pexelsphoto5555 unset(arrar) 將整個陣列清空,但之後如果再加入元素,其 ...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format