替代GET和POST方法从表单发送/接收数据 [英] Alternative to GET and POST methods to send/recieve data from a form

查看:209
本文介绍了替代GET和POST方法从表单发送/接收数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试用PHP构建一个Web应用程序。

I am trying to build a web application in PHP.

但我不想使用GET& POST方法,因为用户应该知道我们发送数据的内容和方式,只需查看html结尾即可。当然,我们总是可以清理数据,但是,我仍然希望保留数据格式给自己。

But I dont want to use the GET & POST methods, as user shall know what and how are we sending the data, just by looking at the html end. Of course we can always sanitize the data, but still, I want to keep the format of data to myself.

上面有替代方法......

Is there an alternative to the above...

可以使用url完成某些操作,这样就不会显示数据的类型和格式。我在这方面看到了与mod重写相关的内容。

can something be done with the url, so that the type and format of data is not revealed. I saw something in this regard that related to mod rewrite.

请建议并告诉我我是否在正确的轨道上。

Please suggest and tell me if I am on the right track.

推荐答案

与其他人放在这里相反,你可以在某些方面做你喜欢的事,虽然它不会达到你的目标:

Contrary to what other people are putting here, you can in some respects do what you like, although it wont accomplish your goal:

PUT / SEARCH / DELETE是RESTful接口的所有概念

PUT / SEARCH / DELETE are all concepts of a RESTful interface

  • http://php.net/manual/en/features.file-upload.put-method.php

如果你想要有创造力......创建一个名为 HIDEFROMUSER的新的并配置您的网络服务器和PHP脚本以在标头中接受此内容。注意,大多数,如果不是所有的浏览器都不支持这个,但jquery ajax调用应该......

If you wanted to be inventive ... create a new one called HIDEFROMUSER and configure your webserver and PHP script to accept this in the headers. Note, most, if not all browsers wont support this, but a jquery ajax call should...

 header('Allow: GET, HEAD, POST, DELETE, HIDEFROMUSER', true, 405);

 $accept = $_SERVER['HTTP_ACCEPT'];
 // does $accept equal one of your allowed methods?



最后 $ yourHiddenWayOfDoingThings =的fopen( 'PHP://输入',' r');

人们仍然会看到你正在做什么如果有效你将无法实现你的期望......

People will still see what you're doing if it works and you wont have achieved your expectations...

这篇关于替代GET和POST方法从表单发送/接收数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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