在单独的主机之间传输变量 [英] Transferring variables between seperate hosts

查看:93
本文介绍了在单独的主机之间传输变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个愚蠢的问题,但你可以通过表格POST将存储在一台服务器上的PHP

页面中的变量传送到另一台服务器上的页面并且是

能够使用Perl在新页面上访问这些变量吗?从我对HTTP b $ b的理解我不明白为什么这应该是一个问题,但它确实

目前似乎不起作用,虽然我确信它不是一个脚本
现阶段
错误


(欢迎任何新手级解释!)


谢谢

马克


This may be a dumb question but can you tranfer variables stored in a PHP
page on one server to a page on a different server via a form POST and be
able to access those variables on the new page using Perl? From my
understanding of HTTP I can''t see why this should be a problem but it does
not seem to work at the moment although I am sure it is not a scripting
error at this stage

(Any newbie-level explanations welcomed!!)

Thanks
Mark



推荐答案

是的,这是可能的。在server1上的PHP / HTML页面的表单标记中,

将操作值定义为第二个服务器的URL,如下所示:


< form action =" http://server2.com/process.cgi">


那就是它......还是我误解了这个问题?
< br $>
-Sauli Karhu


Mark写道:
Yes, it''s possible. In the form tag of the PHP/HTML page on server1,
define the action value as URL to the second server, like this:

<form action="http://server2.com/process.cgi">

That''s it...or did I misunderstand the question?

-Sauli Karhu

Mark wrote:
这可能是一个愚蠢的问题,但你可以转移存储在PHP中的变量吗? />通过表单POST在一台服务器上的页面到另一台服务器上的页面,并且能够使用Perl在新页面上访问这些变量吗?根据我对HTTP的理解,我不明白为什么这应该是一个问题,但它现在似乎不起作用,虽然我确信这不是一个脚本
错误这个阶段

(欢迎任何新手级别的解释!)

谢谢


This may be a dumb question but can you tranfer variables stored in a PHP
page on one server to a page on a different server via a form POST and be
able to access those variables on the new page using Perl? From my
understanding of HTTP I can''t see why this should be a problem but it does
not seem to work at the moment although I am sure it is not a scripting
error at this stage

(Any newbie-level explanations welcomed!!)

Thanks
Mark






Mark写道:
这可能是一个愚蠢的问题,但你可以将存储在PHP
页面中的变量转移到一台服务器上通过表单POST在不同服务器上的页面,并且能够使用Perl在新页面上访问这些变量吗?根据我对HTTP的理解,我不明白为什么这应该是一个问题,但它现在似乎不起作用,虽然我确信这不是一个脚本
错误这个阶段

(欢迎任何新手级别的解释!)

马克
This may be a dumb question but can you tranfer variables stored in a PHP
page on one server to a page on a different server via a form POST and be
able to access those variables on the new page using Perl? From my
understanding of HTTP I can''t see why this should be a problem but it does
not seem to work at the moment although I am sure it is not a scripting
error at this stage

(Any newbie-level explanations welcomed!!)

Thanks
Mark




您的问题的答案是取决于。


您能否向我们展示相关的代码snipettes以及产生的任何错误消息&b
和简要说明你想要完成什么

总是不止一种方式来实现相同的结果 - 并且作为一个新手,

你可能已经选择了最困难的解决方案:)


-

Michael Austin。

顾问 - 可用。

捐款欢迎。 Http://www.firstdbasource.com/donations.html

:)



The answer to your question is "it depends".

Can you show us the relevant code snipettes and any error messages being
produced and a brief description of what you are trying to accomplish. There is
always more than one way to achieve the same outcome - and being a "newbie",
you may have picked the most difficult solution :)

--
Michael Austin.
Consultant - Available.
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)


Mark写道:
Mark wrote:
这可能是一个愚蠢的问题,但你可以转移存储的变量一个服务器上的PHP页面通过表单POST到不同服务器上的页面,并且能够使用Perl在新页面上访问这些变量吗?
This may be a dumb question but can you tranfer variables stored in a PHP
page on one server to a page on a different server via a form POST and be
able to access those variables on the new page using Perl?



1)从PHP(甚至是纯HTML)页面向浏览器发送变量值的常用方法是使用< FORM>标签和几个< INPUT>标签。


2)浏览器可以响应< FORM>的ACTION =部分。标签和

将修改后的,未修改的或隐藏的值发送到目标服务器。


3)用任何语言编写的CGI程序都可以解析来自POST的输入

形成并使用这些值。


先完成第三步。那么第一步应该是微不足道的。

-Joe



1) The usual way of sending variable values from a PHP (or even a plain HTML)
page to the browser is by using a <FORM> tag and several <INPUT> tags.

2) The browser can respond to the ACTION= part of the <FORM> tag and
send modified, unmodified, or hidden values to the target server.

3) CGI programs written in any language can parse input from the POSTed
form and use the values.

Get the third step working first. Then it should be trivial to do
the first step.
-Joe


这篇关于在单独的主机之间传输变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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