我試圖啓動一個PHP會話從形式存儲數據,而用戶登錄,然後顯示在頁面上,他們已經登錄後。迄今爲止所有的嘗試都失敗了,我不明白我做錯了什麼。如果你能告訴我我哪裏出了問題,那麼這是我的程序。PHP會話困難
步驟1
第一頁上有一個形式已經從較早接收到的數據。這些數據中的一部分需要在頁面頂部進入會話,然後再進行其他任何操作。
<?php
session_start();
$_SESSION['booking-form'] = array('GT_title' => $SEStitle, 'GT_actual_duration' => $SESactualduration, 'cal_startdate' => $SEScalstartdate, 'GT_picture' => $SESpicture, 'GT_total_duration' => $SEStotalduration, 'GT_total_dives' => $SEStotaldives, 'GT_total_price' => $SEStotalprice, 'GT_total_duration' => $SEStotalduration, 'GT_specifications' => $SESspecifications);
?>
步驟2
上
步驟3
在成功的用戶登錄用戶被定向到現在被稱爲bookinginitial.php另一頁。
第4步
在bookinginitial .php上的代碼如下。我已經設置了怎樣的3種可能性它可以收集
<?php
session_start();
$_SESSION['booking-form'];
echo $_POST['SEStitle'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php $_SESSION['booking-form'];
echo $_POST['SEStitle'];
?>
<?php
echo $_POST['SEStitle']; ?>
</body>
</html>
現在很明顯,這是不正確的。無論是與會議的陣列,我不知道,因爲我剛剛開始使用PHP,並盡我所能。
任何幫助,將不勝感激。
奇妙,
嘗試的var_dump($ _SESSION),你會看到裏面 – SergeS 2011-02-03 20:17:14