php获取URL中带#号等特殊符号参数的解决方法,
例如下面的PHP代码:
复制代码 代码如下:
echo $_GET['key'];
?>
当url为http://test.com/c.php?key=999时,正常输出:999
当url为http://test.com/c.php?key=9#888时,只能输出:9
而我想要获得的是9#888,那要怎么办呢?只能在把9#888传递给key的这个环节想办法。
我是用JS中的escape函数编码后传递解决了这个问题,需要的朋友可以参考一下。
复制代码 代码如下:
查询
<script><br />
function searchsn() {<br />
var keys = $('#searchs').val();<br />
if (keys == '') {<br />
alert('请填写SN码');<br />
return false;<br />
}<br />
keys = escape(keys); //对字符串进行编码,* @ - _ + . / 这几个字符除外<br />
window.location.href = 'c.php?key=' + keys;<br />
}<br />
</script>
$_SERVER['HTTP_REFERER']
$url = zhidao.baidu.com/question/123456789.html
file_get_contents($url);

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use