<?php
ob_start();
date_default_timezone_set('PRC');
echo <<<文件头
<!DOCTYPE html PUBLIC"-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "
http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml xml; charset=utf-8"/>
<title>评论</title>
</head>
<body>
文件头;
include('con.php');//引用数据库
$hfid=$_GET['ssid'];//提取url后面的值
if($_COOKIE["username"])判断是否登陆
{//登陆后所执行的代码
$yh=$_COOKIE["username"];
$h="SELECT * FROM tzss
WHERE id='hfid'";//查找贴子id
$sss=mysql_query($h);
$row1=mysql_fetch_array($sss);
$ss=$row1['yhid'];//提取发帖人id
$ssname=$row1['ssn
ame'];//贴子内容
$date=$row1['date'];//发表时间
$ssl="SELECT * FROM user
WHERE id='$ss'";//根据发帖人id提取发帖人用户名
$sss1=mysql_query($ssl);
$row2=mysql_fetch_array($sss1);
$yhname=$row2['name'];//用户名
echo"{$yhname}:{$ssname}<br>发表时间:{$date}";//为什么不能输出出?是不是查询语法有错误?还是?
echo <<<评论
<form method="post" action="index.php">
<br>评论列表<br>
<input type="text" name="name" value=
""/>
<input type="submit" name="ok"value="评论" />
</form>
评论;
}
//没有登陆所执行后面的语句
else{
header("Location:dl.php");//跳转到登陆页}
?>