如何让这个很长的网址显得很短?
我已经使我的大部分网站对 SE 友好,但我的网站的一部分让我烦恼...
我的其中一个页面中有一个巨大的表单,提交表单时 (action=php_page) URL 太长,涵盖了半个单词文档中包含所有传递的变量...
这非常丑陋...
有什么方法可以让这个长 URL 看起来很短吗?
或者您知道其他一些解决方案?
如果您需要更多意见,请告诉我...
谢谢
I have made most my site SE friendly, but one part of my site bugs me...
I have a HUGE form in one of the pages, and when submitting the form (action=php_page) URL is so long it covers half a word document in one line with all the passing variables...
This is very ugly...
Is there any way to make this long URL appear short?
Or some other solution you know of?
Let me know if you need more input...
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 POST 而不是 GET 怎么样?
在
action.php
中,您必须使用$_POST
而不是$_GET
。请记住,您应该始终使用
header('success.php');< 重定向到一个在处理表单后显示操作成功的页面(在本例中为
action.php
)。 /代码>。如果用户要刷新页面,该操作不会发生两次(如果您要将某些内容写入数据库或类似的内容,这将是不幸的)。How about using POST instead of GET?
In
action.php
you would have to use$_POST
instead of$_GET
.Remember that you should always redirect to a page that shows that the action is successful after processing a form (in this case in
action.php
) usingheader('success.php');
. If the user were to refresh the page, the action won't happen twice (which would be unfortunate if you were to write something to a database or something similar).您可以使用 POST 代替 GET,尽管它不能添加书签,对 SEO 不太友好,甚至不如长 URL 友好。如果人们应该能够为其添加书签/将其视为链接,那么您大约有 4 个选择:
You can use POST instead of a GET, although it wouldn't be bookmarkable, not very SEO friendy, less friendly then a long URL even. If people should be able to bookmark it/ treat it as a link, you have about 4 options: