如何使这个非常长的网址显示简短? [英] How to make this very long url appear short?

查看:223
本文介绍了如何使这个非常长的网址显示简短?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使我的网站大部分时间都很友好,但我网站的一部分让我感到不安...

我在其中一页中使用了巨大的表单,当提交表单(action = php_page)的URL太长时,它会覆盖半个字的文档,并且包含所有传递的变量...

这非常难看。 ..



有什么办法可以让这个长URL看起来很短吗?



或者你知道的其他一些解决方案



感谢您

让我知道您是否需要更多输入... $ b

解决方案

如何使用POST而不是GET?

 < form action =action.phpmethod =post> 

action.php 中,您必须使用 $ _ POST 而不是 $ _ GET



你应该总是重定向到一个页面,该页面通过使用头部处理表单(在这种情况下在 action.php 中)来显示操作成功'success.php'); 。如果用户刷新页面,那么这个操作不会发生两次(如果您要将某些内容写入数据库或类似的东西,这将是不幸的)。


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

解决方案

How about using POST instead of GET?

<form action="action.php" method="post">

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) using header('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).

这篇关于如何使这个非常长的网址显示简短?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆