一個月前,我的會話沒有保留我自己的網頁之間的值,所以通過更改文件類型從UTF-8到UTF8-沒有BOM我的問題解決了。 現在我正在使用銀行網絡服務,我成功地調用了它的方法。通過發佈表單將我的網頁重定向到銀行頁面,付款後重定向到我的網站,我的會話數組爲空!爲什麼我的會話在重定向後不工作?
我的會議不保留其價值......爲什麼?
之前重定向(process1.php):
<?php
session_start(); // first line and without space
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("form").submit();
});
</script>
</head>
<body>
<?php
$_SESSION['price']=1000;
$_SESSION['username']="14276912";
$_SESSION['password']="874593a";
$_SESSION['ReturnURL']="www.mysite.com/process3.php";
$params=array(//parameters);
$client=new SoapClient("https://bankname.com/MerchantUtility.asmx?wsdl");
$result=$client->__soapCall('bpPayRequest', array($params));
$RefId=$result[0];
?>
<form method="post" action="https://bankname.com/pgwchannel/startpay">
<input name="RefId" value="<?php echo $RefId?>" type="hidden"/>
</form>
</body>
</html>
從重定向頁面復出(process2.php)後:
<?php
session_start(); // first line and without space
var_dump($_SESSION);
?>
的var_dump顯示陣列(0){} 我很困惑。
你提交到其他頁面? –
是我從** process2.php **將表格發佈到銀行的gatway,所以process2.php重定向到銀行的付款頁面。在銀行方面的付款操作之後,銀行將結果發佈到我的** process3.php **並重定向到它。 – Javid