一个session传值的问题
ddddaaaaaa.php
========================================================
<?php
require 'zys_config.php';
session_start();
if($_POST['name']==''||$_POST['pwd']=='')
{
echo "请输入用户名和密码" ;
}
else
{
$conne=mysql_connect("localhost",DB_USER,"5049") or die("could not connect");
mysql_select_db("zysshop168",$conne) or die("could not select");
$query="select pwd from userinfo where name='$_POST[name]' ";
$res=mysql_query($query);
$row = mysql_fetch_object($res);
$_session['name']=$_POST[name];
if ( $row->pwd==trim($_POST[pwd]) ){
echo "<meta http-equiv=refresh content=0;url=Untitled-1.php>";
}
else
{
echo "用户不存在!";
}
}
?>
Untitled-1.php
====================================================
<?php session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>无标题文档</title>
</head>
<body>
<table width="200" border="0">
<tr>
<td><form id="form1" name="form1" method="post" action="ddddaaaaaa.php">
<label>
<input name="name" type="text" id="name" />
</label>
<label>
<input name="pwd" type="password" id="pwd" />
</label>
<label>
<input type="submit" name="Submit" value="提交" />
</label>
</form>
</td>
</tr>
</table>
<?php
echo $_SESSION['name'];
?>
</body>
</html>
为什么正确登录后想显示Untitled-1.php中的echo $_SESSION['name'];值显示不了。