php中的$_GET如何获取带有“#”的参数

WBOY
Release: 2016-06-23 13:50:24
Original
1132 people have browsed it

<?phpecho $_GET['key'];?>
Copy after login

当url为http://test.com/c.php?key=999时,正常输出:999

当url为http://test.com/c.php?key=9#888时,只能输出:9

而我想要获得的是9#888,那要怎么办呢?只能在把9#888传递给key的这个环节想办法。

<input placeholder="输入SN码" type="text" id="searchs" name="searchs"><a class="btn" onclick="searchsn();" href="javascript:;">查询</a><script>    function searchsn() {        var keys = $('#searchs').val();        if (keys == '') {            alert('请填写SN码');            return false;        }        keys = escape(keys); //对字符串进行编码,* @ - _ + . / 这几个字符除外        window.location.href = 'c.php?key=' + keys;    }</script>
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!