checkfirm.php:session_start();
$_SESSION['ProdIdx']=$ProdIdx;
header('location: styel1.php');
styel1.php:session_start();
echo $_SESSION['ProdIdx'];
$_SESSION['ProdIdx']=$ProdIdx;
header('location: styel1.php');
styel1.php:session_start();
echo $_SESSION['ProdIdx'];
if ($numrows_buy!=0) //判断该序列号是不是被使用过!
{
echo "该序列号已被使用过";
}
else
{
// echo "数据验证通过";
session_start();
$_SESSION['ProdIdx']=$ProdIdx;
header("Location:style.php"); //网页跳转;
} style1.php <tr>
<td>
<div align="left">
<?php
session_start();
echo $_SESSION['ProdIdx'];
?>
</div></td>
</tr>
错误内容Warning: session_start(): Cannot send session cookie - headers already sent by (output started at D:\my work\stempsite\gb2312\style1.php:6) in D:\my work\stempsite\gb2312\style1.php on line 101Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:\my work\stempsite\gb2312\style1.php:6) in D:\my work\stempsite\gb2312\style1.php on line 101
222222222222
checkfirm.php
if ($numrows_buy!=0) //判断该序列号是不是被使用过!
{
echo "该序列号已被使用过";
}
else
{
// echo "数据验证通过";
session_start();
$_SESSION['ProdIdx']=$ProdIdx;
header("Location:style.php"); //网页跳转;
} style1.php <tr>
<td>
<div align="left">
<?php
echo $_SESSION['ProdIdx'];
?>
</div></td>
</tr>改成这样后,读不到数据,这是为什么?
session_start();
echo $_SESSION['ProdIdx'];
?>
<?php
session_start();
echo $_SESSION['ProdIdx'];
?>
后会抱错的阿,
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at D:\my work\stempsite\gb2312\style1.php:6) in D:\my work\stempsite\gb2312\style1.php on line 101Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at D:\my work\stempsite\gb2312\style1.php:6) in D:\my work\stempsite\gb2312\style1.php on line 101
222222222222
<tr>
<td>
<div align="left">
<?php
echo $_SESSION['ProdIdx'];
?>
</div></td>
</tr>