Home > Backend Development > PHP Tutorial > get传递的疑惑

get传递的疑惑

WBOY
Release: 2016-06-23 14:23:16
Original
827 people have browsed it

本帖最后由 butter15 于 2013-10-03 15:22:17 编辑



  




  



以上代码运行成html,比如我输入123,然后按搜索,地址会跳转到/macd/key.php?=123
有什么办法可以修改成我输入123,按搜索,地址跳转到/macd/key.php?123

回复讨论(解决方案)

这样可以

<form action="/macd/key.php" method="post" target="_blank" onsubmit="return myfunc(this)">  <div class="s_ipt"><input maxlength="64" type="text" name="" value="123" /></div><button type="submit" class="s_btn">搜索</button>  </form><script>function myfunc(f) {  f.action = f.action + '?' + f.elements[0].value;  f.submit();  return false;}</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