【发布时间】:2015-10-18 21:24:25
【问题描述】:
我想从 url 中删除 GET 参数:
http://localhost/fadt/admin/edit_country.php?id=7
我希望我的网址变成:
http://localhost/fadt/admin/edit_country
这是当前生成链接的方式:
<button onClick="location.href='edit_country?id=<?php echo $row['COUNTRY_ID']; ?>'" class="btn btn-primary btn-xs" title="Edit"><i class="fa fa-pencil"></i></button>
【问题讨论】:
-
不知道我是否理解这个问题。您想从您输入的内容中删除它吗?
-
你需要 htaccess - addedbytes.com/articles/for-beginners/…
-
我想删除 url 中的 id 值
-
如果它不在您的 url 上,它不会被发送到您的服务器。如果您想将其发送到您的服务器但不显示在 url 上使用表单发送 post 请求,这将比在 url 上显示 id 但会隐藏 url 中的值造成更多麻烦。
-
如果不包含变量(上面代码中的 7 ),那么脚本(edit_country.php)如何知道要编辑哪条记录??
标签: php apache .htaccess mod-rewrite