我正在将第三方模块集成到我的网站中。我阅读了他们的文档,但我坚持这一行:
“然后,您的脚本应该对我们的服务器进行服务器到服务器的发布。例如: https://www.domain.com:XXXX/gateway...”
这是什么?我用 POST 形式编写了一个 php 页面:
<form action"https://www.domain.com:XXXX/..." method="post">
...
<input type="submit">
是这样的吗?
然后做一个响应,假设他们发回“result=ok”,然后我捕获结果并检查结果是好还是失败?
我这样解释,我不知道我做的是否正确。有人可以建议吗?什么是服务器到服务器发布?
I am integrating a 3rd party module into my site. I read their documention, but I stuck at this line:
"Your script should then do a server-to-server posting to our server. For example: https://www.domain.com:XXXX/gateway..."
What is it? I write a php page with a POST-form:
<form action"https://www.domain.com:XXXX/..." method="post">
...
<input type="submit">
Is it something like that?
Then do a response, let say they send back "result=ok", then I catch the result and do a check whether the result is okay or failed?
I interpret in this way, I dont know if I am doing the correct thing. CAn anyone advice? What is the server-to-server posting?
发布评论
评论(1)
服务器到服务器的发布意味着在您的服务器上运行的程序向在供应商的服务器上运行的网关发出 HTTP POST。您提供的代码片段是 HTML。您需要有 PHP(或其他语言)的代码片段来执行 POST。 (如果您使用 JavaScript 执行此操作,则帖子将来自用户的 Web 浏览器,这不是您想要的。)
您想要使用 PHP
HttpRequest
类。看一下 PHP 手册中的示例#2,转载于此处:A server-to-server posting means that the program running on your server makes an HTTP POST to a gateway running on the vendor's server. The code fragment that you provided is HTML. You will need to have a code fragment in PHP (or some other language) to execute the POST. (If you did it in JavaScript, the post will come from your user's web browser, which is not what you want.)
You want to use the PHP
HttpRequest
class. Take a look at Example #2 in the PHP Manual, reprinted here: