已掉线,重新登录

首页 > 绿虎论坛 > 历史版块 > 编程 > PHP > 讨论/求助

标题: 求大神帮忙排错

作者: @Ta

时间: 2013-08-20

点击: 2029

<!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="text/html; charset=utf-8"/>
<tittle>DG留言本</tittle>
<script language="JavaScript">
function InputCheck(form1){
  if(form1.nickname.value == "")  
{
    alert("请输入您的昵称。");    form1.nickname.focus(); 
   return (false);  }  if(form1.content.value == "")  
{
    alert("留言内容不可为空。");    form1.content.focus();
    return (false);  }
}
</script>
</head>
<body>
<h3>留言列表</h3><?php
include 'conn.php';
include 'config.php';
$p=$_GET['p']?$_GET['p']:1;
$offset = ($p-1)*$pagesize;
$sql1='select * from guest ORDER BY id DESC LIMIT $offset,$pagesize';
$result=$db->query($sql1);
if(!$result) exit('查询数据库错误');

while($row=$result->fetch_all())
{
$content=nl2br($row['content']);
echo $row['name'].'&nbsp';
echo '发表于:'.date("Y-m-d H:i",$row['creattime']).'<br/>';
echo ''.nl2br($row['content']).'<br/>';
if(!empty($row['replytime'])) {
        echo '----------------------------<br />';        echo '管理员回复于:'.date("Y-m-d H:i", $gb_array['replytime']).'<br />';        echo nl2br($row['reply']).'<br /><br />';
    }echo '<hr/>';
}
$count_result = $db->query("SELECT count(*) FROM guest");
$count_array = $count_result->fetch_all();
$pagenum=ceil($count_array['count(*)']/$pagesize);
echo '共'.$count_array['count(*)'].' 条留言';
if ($pagenum > 1) {
    for($i=1;$i<=$pagenum;$i++)
 {
        if($i==$p) {
            echo '&nbsp;['.$i.']';        }
 else {
            echo '&nbsp;<a href="index.php?p='.$i.'">'.$i.'</a>';        }
    }
}
?>
<form id="form1" name="form1" method="post" action="submiting.php" onSubmit="return InputCheck(this)">
<h2>发表留言</h2>
<p>
<label for="title">昵&nbsp;&nbsp;&nbsp;&nbsp;称:</label><input id="nickname" name="nickname" type="text"/>
<span>(必须填写,不超过16个字符串)</span></p>
<p><label for="title">电子邮件:</label><input id="email" name="email" type="text" /><span>(非必须,不超过60个字符串)</span></p>
<p><label for="title">留言内容:</label><textarea id="content" name="content" cols="50" rows="8"></textarea></p>
<input type="submit" name="submit" value="  确 定  " /></form>

</body>
</html>
以上是代码,但是,表单部分没有显示,如演示http://dome.poxo.cc这是什么原因呢?局中人看不清,所以请各位看客帮忙看看。

[隐藏样式|查看源码]


『回复列表(4|隐藏机器人聊天)』

1. 你把表单放到php前面试试。
(/@Ta/2013-08-20 18:45//)

2. @残缘,可以了,这是什么原因呢?
(/@Ta/2013-08-20 18:49//)

3. 因为php前面执行了exit,后面的就不执行了。
(/@Ta/2013-08-20 18:55//)

4. @残缘,哦,明白了。谢谢!!!
(/@Ta/2013-08-20 18:56//)

回复需要登录

7月24日 18:15 星期四

本站由hu60wap6驱动

备案号: 京ICP备18041936号-1