有很多方法可以做到這一點,一個辦法是一個SOAP客戶機/服務器解決方案發送urlencoded的價值觀..:
你基本上有2個PHP文件,server1上的一個文件是let client.php,在另一個服務器上有一個名爲server.php的文件,它將接收從服務器1上的client.php發送的所有數據。這裏有一個簡單的源代碼,你需要將腳本中的URL改爲你的服務器版本/客戶端的網址,以便它的工作原理..:
client.php
<?php
//This is the SOAP Client which will call a method on Server 2 with passing some data:
//uri is the location where client.php is located, and "location" is the exact location to the client, including the name "client.php"
$client=new SoapClient(NULL,array("uri"=>"http://localhost/test","location"=>"http://localhost/test/test.php"));
$message=$client->hello("Hello World");
echo($message);
?>
server.php
<?php
//This is the SOAP Server
class server2{
public function hello($data){
return "I received following data: " . $data;
}
}
//the URI here is the location where the server.php is located.
$settings = array("uri"=>"http://localhost/test/");
$s=new SoapServer(null,$settings);
$s->setClass("server2");
$s->handle();
?>
使用anchror('')通過'送你的變量GET'。 – 2012-07-11 07:30:47