<?php
session_start();
$_SESSION[‘username‘]="dddddddddd";
if($_SESSION[‘username‘]==null){
echo "<script>location.href(‘session.php‘)</script>";
}
$con = mysql_connect("localhost","root","");
if(!$con){
die("connect error".mysql_error());
}
mysql_select_db("cnxinwa",$con);
$sql="select * from `users` where 1 ";
$result= mysql_query($sql);
//while ($row=mysql_fetch_array($result))
//{
// echo $row[‘username‘] . "<br />";
//}
$row=mysql_fetch_assoc($result);
//echo "用户名:". $row["username"] ."密码:" . $row["password"];
?>
<!DOCTYPE table PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><HEAD><TITLE></TITLE></HEAD>
<body>
<table>
<tr><td><?php echo $row["username"] ?></td></tr>
<tr><td><?php echo $row["password"] ?></td></tr>
</table>
</body>
</html>