我对获得会话变量对会话变量不能被访问到不同的页面
我有三个PHP脚本 1. index.php的不同页面的工作问题(包括HTML格式)
<?php
session_start();
if (isset($_POST['submit'])) {
$_SESSION['billTo_email'] = $_POST['billTo_email'];
}
?>
<form id = 'form_submit' method="post" action = "NetworkOnline.php">
<td><input type="text" name="billTo_email" id="f_name2" /></td>
<td><input type="submit" name="submit" id="submit" value="Submit"/></td>
</form>
?>
NetworkOnline.php
<?php session_start(); $_SESSION['billTo_email'] = $_POST["billTo_email"]; ?> $f_name=$_POST["f_name"]; $l_name=$_POST["l_name"]; $billTo_country=$_POST["billTo_country"]; $billTo_city=$_POST["billTo_city"]; $billTo_state=$_POST["billTo_state"]; $billTo_street1=$_POST["billTo_street1"]; $billTo_pin=$_POST["billTo_pin"]; $billTo_email = $_SESSION["billTo_email"];
response.php
<?php session_start(); $_SESSION["billTo_email"] = $_POST["billTo_email"]; ?> <form name = "form1" method = "post" action="mail.php" > <input type="hidden" name="order" id="order" value="<?php echo $order ?>" > <input type="hidden" name="bank" id="bank" value="<?php echo $bank ?>" > <input type="hidden" name="amount" id="amount" value="<?php echo $amount ?>" > <input type = "test" name= "email" id ="email" value= "<?php echo $billTo_email ?>"> <input type="submit" id="submit" value="submit" name="submit"> </form>
NetworkOnline.php上的结束标记位置错误。 –