完成某个操作后将数据发送到脚本的最简单方法是什么?
我正在构建一个脚本来处理发送给它的数据。此数据将采用 id=xyz
和 key=j9ofi902f89djs8if
的形式,其中 id
和 key
分别针对每个数据将数据发送到我的脚本的脚本。我正在尝试想出一种万无一失的方法,让任何想要将此数据发送到我的脚本的人都变得非常简单。
我的处理脚本将用 PHP 构建。向其发送数据的脚本不会位于同一域中。需要在发送页面按下某个按钮并验证表单没有错误后发送数据。我希望能够自己控制发送和接收的过程,但我想不出办法做到这一点。有没有一种方法可以全面实现这一点?
如果没有,最好的方法是什么,以便使用自己的语言和方法的每个不同的发送脚本可以轻松地将其发送到我的脚本。 POST 或 GET 或其他方式会更好吗?我想这样做,以便他们可以在处理表单的过程中发送数据,并在向我发送数据后在脚本上继续执行其他操作。有什么想法吗?
I am building a script that will handle data that is sent to it. This data will be in the form of id=xyz
and key=j9ofi902f89djs8if
with id
and key
particular to each script that is sending the data to my script. I am trying to think of a fool proof way that would make it exceedingly simple for anyone who wants to send this data to my script to do it.
My handling script will be built in PHP. The scripts sending the data to it will not be on the same domain. The data needs to be sent after a certain button is pressed the sending page and the form is verified that it has no errors. I would like to be able to control the process of sending and receiving all myself, but I cannot think of a way to do that. Is there a way to do this that would work across the board?
If not, what would be the best way to make it so that each different sending script that uses their own language, and method can easily send it to my script. Would a POST or a GET or something else be better. I want to make it so that they can send the data in the middle of their handling the form and on the script proceed to do other things after they send me the data. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 AJAX,通过 AJAX 发送数据,无需页面刷新或使用 post 选项完成的页面重定向。我认为这是适合您应用的最佳解决方案。
Ajax 教程。
Use AJAX, send the data through AJAX without a page refresh or a page redirect that is done with the post option. I think it is the best solution for your application.
Ajax tutorial.