Home > Backend Development > PHP Tutorial > 用url传递参数时后面多出字符会是什么原因?解决办法

用url传递参数时后面多出字符会是什么原因?解决办法

WBOY
Release: 2016-06-13 13:30:06
Original
1270 people have browsed it

用url传递参数时后面多出字符会是什么原因?

HTML code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
$prev = $page - 1;
echo "<a id="submitbuttons" href="menu_icon.php?page=%22.%24prev.%22'">上一页</a>";

Copy after login

结果点击“上一页”时url是GET http://localhost/test/html/test.php?page=1%27,而且到上一页后虽然页面上的元素都能显示,但是不再执行JS了。这是什么原因?

------解决方案--------------------
仔细看你的url

href=……' 引号部分

%27,恰好是'
------解决方案--------------------
echo "上一页";
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