想在留言板里添加一个分类作为心情日记来用,将
ecms\e\tool\gbook\
里的index.php复制一个2index.php作为心情日记首页文件来用,修改里面所调用的模板文件路径,然后在
ecms\e\data\template\
里添加相应的模板文件,这样做好后按路径访问看到了效果,但是现在的问题是:当一添加留言后返回总是到:
http://localhost/e/tool/gbook/
能否让它返回到:http://localhost/e/tool/gbook/2index.php啊?
在代码里看不出跳转地址的代码,请wc帮助一下!
<? require("../../class/connect.php"); include("../../class/db_sql.php"); include("../../class/config.php"); include("../../class/q_functions.php"); include("../../data/language/fun.php"); $link=db_connect(); $empire=new mysqlquery(); $editor=1; //分类id if($_GET['bid']) { $bid=(int)$_GET['bid']; $num=$empire->num("select bid from phome_enewsgbookclass where bid='$bid'"); if(empty($num)) { echo"<script>alert('此留言板不存在');history.go(-1);</script>"; exit(); } $set=setcookie("ecmsgbookbid",$bid,0,"/",""); } else { $bid=(int)$_COOKIE['ecmsgbookbid']; if(empty($bid)) { echo"<script>alert('此留言板不存在');history.go(-1);</script>"; exit(); } } $page=$_GET['page']; $start=$_GET['start']; $line=12;//每页显示条数 $page_line=12;//每页显示链接数 if(empty($page)) {$page=0;} if(empty($start)) {$start=0;} $offset=$start+$page*$line;//总偏移量 $totalquery="select count(lyid) as total from phome_enewsgbook where bid='$bid' and checked=0"; $num=$empire->gettotal($totalquery);//取得总条数 $query="select lyid,name,email,`call`,lytime,lytext,retext,bid from phome_enewsgbook where bid='$bid' and checked=0"; $query=$query." order by lyid desc limit $offset,$line"; $sql=$empire->query($query); $returnpage=page1($num,$line,$page_line,$start,$page,$search); $url="<a href=../../../2index.php>首页</a> > 心情日记"; include("../../data/template/2cp_1.php"); ?> <? while($r=$empire->fetch($sql)) { //是否有回复 if(empty($r[retext])) { $retext=""; } else { $retext="<table width=100% border=0 align=center cellpadding=3 cellspacing=1> <tr> <td><img src=../../data/images/regb.gif width=18 height=18><strong><font color=#FF0000>回复:</font></strong> ".nl2br($r[retext])." </td> </tr> </table>"; } ?> <table width="600" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder> <tr class=header> <td width="55%" height="23">留言者: <?=$r[name]?> </td> <td width="45%">留言时间: <?=$r[lytime]?> </td> </tr> <tr bgcolor="#FFFFFF"> <td height="23" colspan="2"> <table border=0 width=100% cellspacing=1 cellpadding=10 bgcolor='#cccccc'> <tr> <td width='100%' bgcolor='#FFFFFF' style='word-break:break-all'> <?=nl2br($r[lytext])?> </td> </tr> </table> <?=$retext?> </td> </tr> </table> <br> <? } ?> <table width="600" border="0" align="center" cellpadding="3" cellspacing="1"> <tr> <td>分页:<?=$returnpage?></td> </tr> </table> <form name="form1" method="post" action="../../enews/index.php"> <table width="600" border="0" align="center" cellpadding="3" cellspacing="1"class=tableborder> <tr class=header> <td height="23" colspan="2">添加日记:</td> </tr> <tr bgcolor="#FFFFFF"> <td width="142" height="23">姓名:</td> <td width="443" height="23"><input name="name" type="text" id="name"> *</td> </tr> <tr bgcolor="#FFFFFF"> <td height="23">联系邮箱:</td> <td height="23"><input name="email" type="text" id="email"> *</td> </tr> <tr bgcolor="#FFFFFF"> <td height="23">联系电话:</td> <td height="23"><input name="call" type="text" id="name3"></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23">日记内容(*):</td> <td height="23"><textarea name="lytext" cols="60" rows="12" id="name4"></textarea></td> </tr> <tr bgcolor="#FFFFFF"> <td height="23"> </td> <td height="23"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"> <input name="enews" type="hidden" id="enews" value="AddGbook"></td> </tr> </table> </form> <? include("../../data/template/2cp_2.php"); db_close(); $empire=null; ?>
|