我在一個會話中存儲了一個數組,我正在發送到遠程服務器上的一個函數。我正在使用這些值來放入遠程數據庫。我的問題是陣列正在發送,但它是空的。在遠程計算機上使用存儲在會話中的數組
發送
<?php
session_start();
require_once('lib/nusoap.php');
$blah = $_SESSION['blah'];
$client = new nusoap_client('http://myserver.com/datatest.php' );
$response = $client->call('myfunction', $blah);
?>
在遠程服務器:
<?php
require_once('lib/nusoap.php');
$server = new soap_server();
$server->register('myfunction');
function myfuction ($blah)
{
//MY DB CONNECTIONS
$row = $blah;
$count = count($row);
for($i=0;$i<=$count-1;$i++){
$value1 = '8';
$item = $i+1;
$first = $row[$i]['first'];
$second = $row[$i]['second'];
$time = date("His");
$month = date("m");
$day = date("d");
$year = date("y");
$julian = juliantojd($month, $day, $year);
$sql = "INSERT INTO `MYTABLE` (value1, item, first, second, time, julian) VALUES ('$value1', '$item', '$first', '$second', '$time', '$julian')";
return $code_showing_query;
}
}
?>
當我執行這一點,我在服務器上設置的可變因素(項,值1等)插入到數據庫,但我發送的第一個和第二個是emtpy。
我可以返回我發送的$ blah數組,並返回值。當然會話仍然在我的瀏覽器中,但我失去了它去遠程服務器。我曾嘗試以下內容:(肯定它不是去上班,但我試過)
<?php
$blah = $_SESSION['blah'];
$blah = serialize($blah);
$blah = base64_encode($blah);
//AT THE REMOTE SERVER
$blah = base64_decode($blah);
$blah = unserialize($blah);
?>
基本上,我需要找到除了愛情之外,以找到除了愛情之外,使陣列我從會話失控的我會話發送到遠程服務器,因此它不會關聯到會話。在此之前,我必須保留所有內容,因爲這是一個訂購系統,我必須將最終訂單發佈到遠程iSeries。
我知道這是一些簡單的...只是我還沒有做過和/或它只是絆倒methanks任何幫助