dongzhunqiu4841 2014-06-20 12:02
浏览 55
已采纳

使用GET数据提交PHP表单的问题

I am working with PHP forms. The opening form tag looks like this:

<form name="adv_search_form" action="<?php echo $targetpage; ?>" method="GET">

This generated the following HTML:

<form name="adv_search_form" action="index.php?&amp;rel=common_listing&amp;module=company&amp;sort_option=&amp;search_option=&amp;show_max_row=15" method="GET">

When I submit this form, I land on a URL:

http://localhost/projectcode12may2014/ampanel/index.php?field%5B%5D=broker_name&adv_operation%5B%5D=LIKE&value%5B%5D=&query_type%5B%5D=AND&submit=Submit

But what I want is that

?field%5B%5D=broker_name&adv_operation%5B%5D=LIKE&value%5B%5D=&query_type%5B%5D=AND&submit=Submit

should be appended to the action URL on the landing page. Can anyone suggest any good method for doing this? Thanks in advance.

  • 写回答

3条回答 默认 最新

  • duan5801 2014-06-20 12:06
    关注

    If you are using method="get" the parameters in action are overwritten. Only what is in the from will be transmitted.

    You need to add hidden fields for all these values. For example:

    <input type="hidden" name="module" value="company" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 matlab计算中误差
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊