欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

我的论坛源代码(六)

程序员文章站 2022-03-14 10:03:13
repal.php回复用的页面,因为回复可以不必要是用户,所以没加用户身份校验 回复论题:&l...</div> <div class="content"> repal.php回复用的页面,因为回复可以不必要是用户,所以没加用户身份校验 <br><br><html> <br><head> <br><title>回复论题:<? echo $zt;?></title> <br><meta http-equiv="content-type" content="text/html; charset=gb2312"> <br><style type=text/css> <br>p {font-family: normal; font-size: 9pt; line-height: 14pt} <br>div {font-family: normal; font-size: 9pt; line-height: 14pt} <br></style> <br><link href="js/cpcw.css" rel=stylesheet /link> <br><?php <br>include "linkfox.inc.php";               //包含进文件 <br>include "info.inc.php"; <br><br>function yy($f) <br>{ <br>  $oldmess=@file($f);                                    //引用原文处理 <br>  for ($i=0;$i<count($oldmess);$i++) <br>  { <br>   if (ord(substr($oldmess[$i],0,1))==161)   //第一位是否全角空格 <br>   $mess=$mess.$oldmess[$i]; <br>   else $mess=$mess."  ".trim($oldmess[$i]); <br>  } <br>  return $mess; <br>} <br><br>function mesput($query,$use,$id)       <br>{ <br>      $req=mysql_query($query); <br>      if ($req) <br>        { <br>          echo "<script language='javascript'> alert('谢谢你的回复!系统将返回论题!'); </script>"; <br>          echo "<script language='javascript'> javascript:location.href='dispbbs.php?id=".$id."&use=".$use."'; </script>;"; <br>          echo "<div align='center'><a href='dispbbs.php?id=".$id."&use=".$use."'>如果系统没有反应,请点击</a></a>"; <br>        } <br>      else <br>      echo  "<script language='javascript'> alert('写入失败!'); </script>"; <br>} <br>function usehf($message,$useinfo,$id,$use,$ft,$mess,$c)         //用户回复就直接从表里调出用户信息 <br>{ <br>   $query="select * from useinfo where usename='".$useinfo[0]."'"; <br>   $req=mysql_query($query); <br>      if ($req) <br>         { <br>             $useinfo=mysql_fetch_array($req); <br>             $fo=fopen($ft,"a"); <br>             $message=str_replace("<","<",str_replace(">",">",$message)); <br>             $message=nl2br($message); <br>             $gip=getenv("remote_addr"); <br>             $messages=$message."ㄞㄚㄓ".$useinfo[2]."ㄞㄚㄓ".$useinfo[3]."ㄞㄚㄓ".$useinfo[9]."ㄞㄚㄓ".$useinfo[8]."ㄞㄚㄓ".$useinfo[14]."ㄞㄚㄓ".$useinfo[11]."ㄞㄚㄓ".$time."ㄞㄚㄓ".$gip."δεζ"; <br>            if($c==dd)       //如果是引用回复,加上原文内容 <br>               { <br>          $messages="<font color='999999'>".$mess."<div align='center'>★原文……★……引用★</div></font><br>".$messages; <br>               } <br>             $fp=fputs($fo,$messages); <br>             $time=date(y年n月j日g时i分);   //主题回复数加一,覆盖上一回复人与时间 <br>             $query="update foxbbs set hfnum=hfnum+1,hfname='".$ft."',hfusename='".$useinfo[2]."',hfdate='".$time."' where id='".$id."'"; <br>             mesput($query,$use,$id); <br>          } <br>      else <br>         { <br>      echo "<script language='javascript'> alert('数据库错误:104号'); </script>"; <br>         } <br>} <br><br>function gr($ft,$message,$youname,$youmail,$youoicq,$youweb,$youaddr,$youbq,$id,$use,$mess,$c)        //非注册用户 <br>{ <br> if (!uinfo($youmail,mail)||strlen($youmail)<12)  //校验mail <br> { <br>     echo "<script language='javascript'> alert('请输入正确的mail地址!'); </script>"; <br> } <br> else if (!uinfo($youoicq,oicq)||strlen($youoicq)>12) //校验oicq,只能判断是否数字和位数,如果有更好的方法就好。 <br> { <br><br>     echo "<script language='javascript'> alert('请输入正确的oicq号!'); </script>"; <br> } <br><br> else <br> { <br>      if (uinfo($youweb,web)==ok&&substr($youweb,0,3)!=htt) $youweb="http://".$youweb; <br>      else if (uinfo($youweb,web)==ok&&substr($youweb,0,3)==htt) $youweb=$youweb; <br>      else $youweb="不告诉你"; <br>      $time=date(y年n月j日g时i分);          //取当前时间 <br>      $message=str_replace("<","<",str_replace(">",">",$message)); <br>      $message=nl2br($message); <br>      $gip=getenv("remote_addr"); <br>      $messages=$message."ㄞㄚㄓ".$youname."ㄞㄚㄓ".$youoicq."ㄞㄚㄓ".$youweb."ㄞㄚㄓ".$youmail."ㄞㄚㄓ".$youbq."ㄞㄚㄓ".$youaddr."ㄞㄚㄓ".$time."ㄞㄚㄓ".$gip."δεζ"; <br>       if($c==dd)       //如果是引用回复 <br>         { <br>        $messages="<font color='999999'>".$mess."<div align='center'>★原文……★……引用★</div></font><br>".$messages; <br>         } <br>      $fo=fopen($ft,"a"); <br>      $fp=fputs($fo,$messages); <br>      $query="update foxbbs set hfnum=hfnum+1,hfname='".$ft."',hfusename='".$youname."',hfdate='".$time."' where id='".$id."'"; <br>      mesput($query,$use,$id); <br> } <br>} <br>?> <br></head> <br><br><body bgcolor="#ffffff"> <br><? <br>$tem=$http_cookie_vars[flyfoxnet]; <br>$temp=explode("|",$tem); <br>$cookiem=$temp[0]; <br>$useinfo=cuser($cookiem,$action); <br><br>if (!$useinfo[0]){  $useinfo[2]="游客"; $usename=1;} <br><br>$query="select mesname from foxbbs where id='".$id."'"; <br>$req=mysql_query($query); <br>  if ($req) <br>  { <br>  $f=mysql_fetch_array($req); <br>  $mess=yy($f[0]); <br>      if ($message&&$action=add) <br>        { <br>          $ft="foxbbs/".$f[0].".bbs"; <br>          if (ord(substr($message,0,1))!=161) $message="  ".$message; <br>          for ($i=0;$i<10;$i++) <br>          { <br>            if ($bq[$i]) $youbq=$bq[$i]; <br>          } <br>          if ($usename)  gr($ft,$message,$youname,$youmail,$youoicq,$youweb,$youaddr,$youbq,$id,$use,$mess,$c); <br>          else usehf($message,$useinfo,$id,$use,$ft,$mess,$c); <br>        } <br>   } <br>   else echo "<script language='javascript'> alert('打开文件错误!可能服务器忙,请稍候再试!'); </script>"; <br><br><br>?> <br><table width="100%" cellpadding="4" cellspacing="0" border="0"> <br>  <tr> <br>    <td height="20"> <br>      <div align="right"></div> <br>    </td> <br>    <td height="20" width="75"> </td> <br>    <td height="20" width="75"> </td> <br>    <td height="20" width="75"> </td> <br>    <td height="20" width="75"> </td> <br>  </tr> <br>  <tr> <br>    <td height="20"> <br>      <div align="right"></div> <br>    </td> <br>   <td height="20" width="10%"> <br>     <div align="center"><a href="reguse.php?action=xy"><img src="images/top_register.gif" width="74" height="21" border="0"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="useinfo.php?action=find"><img src="images/top_members.gif" width="74" height="21" border="0"></a></div> <br>    </td> <br>    <td height="20" width="10%"><a href="useinfo.php?action=edit"><img src="images/top_profile.gif" width="74" height="21" border="0"></a></td> <br>    <td height="20" width="10%"><a href="okey.php?d=q"><img src="images/top_logout.gif" width="74" height="21" border="0"></a></td> <br>  </tr> <br>  <tr> <br>    <td height="20"> <br>      <div align="left">当前位置:<font color="#0000ff">狐网─>狐网论坛─>回复主题:<?echo "<font color='ff0000'>".$zt."</font>";?></font></div> <br>    </td> <br>    <td>    <div align="center"><a href="foxbbs.php"><img src="images/index.gif" width="70" height="20" border="0" align="middle"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="superuse.php"><img src="images/super.gif" width="70" height="20" border="0" align="middle"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="reguse.php?action=xy"><img src="images/dl.gif" width="70" height="20" border="0" align="middle"></a></div> <br>    </td> <br>    <td height="20" width="10%"> <br>      <div align="center"><a href="../index.php"><img src="images/fox.gif" width="70" height="20" border="0" align="middle"></a></div> <br>     </td>  </tr> <br></table> <br><br><script language="javascript"> <br><!-- <br> var submitcount=0; <br><br> function checksubmit() { <br>    if (submitcount == 0) { <br>      submitcount++; <br>      return true; <br>    } else { <br>            if (submitcount>0){ <br>            alert("帖子已成功提交了,别急,等等!"); <br>            return false; <br>      } <br>    } <br> } <br><br>function check_com(){ <br>   if(document.form.youname.value.length ==0){ <br>      submitcount--; <br>      alert("名字不能为空!快填上吧!"); <br>      return false; <br>   } <br>      if(document.form.youmail.value.length ==0){ <br>      submitcount--; <br>      alert("email不能为空!快填上吧!"); <br>      return false; <br>   } <br>   if(document.form.youoicq.value.length ==0){ <br>      submitcount--; <br>      alert("oicq不能为空!快填上吧!"); <br>      return false; <br>   } <br><br><br>   if(document.form.message.value.length == 0){ <br>      submitcount--; <br>      alert("内容不能为空!"); <br>      return false; <br>   } <br>   return true; <br>} <br>//--> <br></script> <br><br><table width='70%' border='0' cellspacing='0' cellpadding='0' bgcolor='#000000' align='center'> <br>  <tr> <br>    <td> <br>      <table width='100%' border='0' cellspacing='0' cellpadding='0'> <br>        <tr bgcolor='#006699'> <br>          <td><div align="center"><font color="ffffff"><? echo "<font color='00ff00'>".$useinfo[2]."</font>"; ?> 你正在回复的主题是:[<? echo $zt; ?>]</font></div></td> <br>        </tr> <br>        <tr bgcolor='#eeeeee'> <br>          <td> <br>    <form name="form" onsubmit="return check_com()" method="post"><div align="center"> <br><? <br>      if ($usename)  //不是注册用户就显示输入框输入游客信息。 <br>      { <br>      echo "你的大名:<input onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' type='text' name='youname' size='30' maxlength='30' value='".$youname."'>"; <br>      echo "oicq:<input onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' type='text' name='youoicq' size='16' maxlength='16' value='".$youoicq."'><br>"; <br>      echo "来自何方:<input onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' type='text' name='youaddr' size='55' value='".$youaddr."'><br>"; <br>      echo "电子信箱:<input onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' type='text' name='youmail' size='55' value='".$youmail."'><br>"; <br>      echo "个人主页:<input onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' type='text' name='youweb' size='55' value='".$youweb."'><br>"; <br>      echo "表情<br><input type='radio' name='bq[0]' value='a'><img src='images/a.gif'><input type='radio' name='bq[1]' value='1'><img src='images/1.gif'>"; <br>      echo "<input type='radio' name='bq[2]' value='2'><img src='images/2.gif'><input type='radio' name='bq[3]' value='3'><img src='images/3.gif'>"; <br>      echo "<input type='radio' name='bq[4]' value='4'><img src='images/4.gif'><input type='radio' name='bq[5]' value='5'><img src='images/5.gif'>"; <br>      echo "<input type='radio' name='bq[6]' value='6'><img src='images/6.gif'><input type='radio' name='bq[7]' value='7'><img src='images/7.gif'>"; <br>      echo "<input type='radio' name='bq[8]' value='8'><img src='images/8.gif'><input type='radio' name='bq[9]' value='9'><img src='images/9.gif'><br>"; <br>      } <br>      echo "<div align='center'>回复内容<br>"; <br>      echo "<textarea onfocus='this.select()' style='background-color: #ffffff; border-bottom: #000000 1px dashed; border-left: #000000 1px dashed; border-right: #000000 1px dashed; border-top: #000000 1px dashed;' name='message' cols='64' rows='5' wrap='virtual'>".$message."</textarea><br>"; <br>            ?> <br>         <input type="submit" name="submit" value="确定" onclick="return checksubmit()">                           <br>         <input type="reset" name="submit2" value="重写"></div></div></form> <br>          </td> <br>        </tr> <br>        <tr bgcolor='#eeeeee'>//如果是引用原文就显示 <br>          <td><div align="center"><? if ($c==dd) echo "原文如下<br><div align='left'>".$mess;?></div></td> <br>        </tr> <br>      </table> <br>    </td> <br>  </tr> <br></table> <br><br></body> <br></html>  </div> <div class="info-pre-next"> <p> 上一篇: <a href="/article/177248.html"> 利用纯JS和HTML Canvas生成随机迷宫过程中产生的有趣的事情 </a> </p> <p> 下一篇: <a href="/article/177250.html"> 枚举例题三:假币问题 </a> </p> </div> <div class="wz_tuijian"> <p> 推荐阅读 </p> <ul> <li> <a href="/article/2190395.html" target="_blank" title="我是如何通过论坛推广产品的?"> <h2> 我是如何通过论坛推广产品的? </h2> </a> </li> <li> <a href="/article/2005614.html" target="_blank" title="浅淡微社区不适合论坛站长的六大原因"> <h2> 浅淡微社区不适合论坛站长的六大原因 </h2> </a> </li> <li> <a href="/article/1974387.html" target="_blank" title="自学Python编程的第六天(最后代码有更好的请告诉我)----------来自苦逼的转行人"> <h2> 自学Python编程的第六天(最后代码有更好的请告诉我)----------来自苦逼的转行人 </h2> </a> </li> <li> <a href="/article/1962077.html" target="_blank" title="微软将开放《我的世界》的AI开发平台源代码"> <h2> 微软将开放《我的世界》的AI开发平台源代码 </h2> </a> </li> <li> <a href="/article/1956722.html" target="_blank" title="我是如何通过论坛推广产品的?"> <h2> 我是如何通过论坛推广产品的? </h2> </a> </li> <li> <a href="/article/1943337.html" target="_blank" title="核桃圈论坛,我最喜欢的网站之一"> <h2> 核桃圈论坛,我最喜欢的网站之一 </h2> </a> </li> <li> <a href="/article/1901050.html" target="_blank" title="我为什么每天定时的去各大论坛签到?论坛签名有什么好处?"> <h2> 我为什么每天定时的去各大论坛签到?论坛签名有什么好处? </h2> </a> </li> <li> <a href="/article/1790114.html" target="_blank" title="[php] 我的微型论坛的简单教程[已完成]第1/8页"> <h2> [php] 我的微型论坛的简单教程[已完成]第1/8页 </h2> </a> </li> <li> <a href="/article/1780431.html" target="_blank" title="四面阿里,三面字节全部都跪了!闭关修炼一个月成功六面进军美团,鬼知道我怎么熬过来的!"> <h2> 四面阿里,三面字节全部都跪了!闭关修炼一个月成功六面进军美团,鬼知道我怎么熬过来的! </h2> </a> </li> <li> <a href="/article/1754043.html" target="_blank" title="我的Java SE总结(六)"> <h2> 我的Java SE总结(六) </h2> </a> </li> </ul> </div> </article> </div> </main> <footer><div class="box"><div class="ft_nav"><div class="ft_about"><p>关于网站</p><ul><li><a href="/sitemap.xml" target="_blank" title="网站地图">网站地图</a></li><li><a href="/list/2/" title="最新程序员文章站">最新程序员文章站</a></li></ul></div><div class="ft_contact"><ul><li>本站所有数据收集于网络如有侵犯到您的权益,请联系我们进行下架处理。</li><li class="email_show"></li></ul></div></div><div class="copyright"><div class="cr_left"><p> 备案号:<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">粤ICP备20058927号</a></p><p>© Copyright © 2020-2022 www.superweb999.com 程序员文章站. </p></div></div></div></footer> </body> </html>