杏林同学录(二)


Posted in PHP onOctober 09, 2006

成员主页:main.php
<?
session_start(); // 开始session
session_register("userregister");
$userregister=$username;
include "class/config.php";
$result = mysql_query("SELECT * FROM user where user='$username'",$db);
if (mysql_num_rows($result)==0){  //若返回列的数目为0,说明无此资料
echo "无此用户!";
exit;}
$userpsw=strtoupper(trim($userpsw));
$password=trim(mysql_result($result,0,'psw'));
$password=strtoupper($password);//取得密码,转换成大写
$userpsw=strtoupper($userpsw);
if (!($userpsw==$password)){
echo "密码错误!";
mysql_close($db);
exit;
}
$name=mysql_result($result,0,"name");
$count=mysql_result($result,0,"count")+1;//成员计数器加1
mysql_query("UPDATE user SET count=$count where user='$username'",$db);
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>欢迎来到杏林同学录</TITLE>
<style type="text/css">
<!--
.deepblue10 {  font-family: "宋体"; font-size: 10pt; color: #3333FF; text-decoration: none}
A.purple:hover {  font-size: 9pt; color: #3366FF; background-color: #99FFFF; text-decoration: none}
A.purple:link {  font-size: 10pt; text-decoration: none}
a:hover {  text-decoration: none}
a:visited {  text-decoration: none}
A.purple {  font-size: 10pt; color: #CC00FF; text-decoration: none}
.white12 {  font-size: 12pt; color: #FFFFFF; text-decoration: none}
.purple {  color: #CC00FF; text-decoration: none; font-size: 10pt}
.brown9 {  font-size: 10pt; color: #6600CC; text-decoration: none}
.black9 {  font-size: 9pt; text-decoration: none}
.yellow12 {  font-size: 12px; color: #9900CC; text-decoration: none; font-weight: normal}
.redlarge {  font-size: 18px; font-weight: bolder; color: #FF00CC}
.grey9 {  font-size: 9pt; color: #CCCCCC}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<table width="755" border="1" height="65" cellpadding="0" cellspacing="0" bordercolorlight="#FF33CC" bordercolordark="#FFFFFF">
  <tr>  
    <td width="241">  
      <div align="right"><img src="class/image/classlogo.gif" width="224" height="60" alt="同学录">  
      </div>
    </td>
    <td width="508"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="478" height="60" align="right">
        <param name=movie value="class/image/2.swf">
        <param name=quality value=high>
        <embed src="class/image/2.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="478" height="60" align="right">
        </embed>  
      </object></td>
  </tr>
</table>
<table width="755" border="0" cellspacing="0" cellpadding="0">
  <tr>  
    <td class="black9" width="302"> 北京时间  
      <? echo date("Y年m月d日");?>
    </td>
    <td class="black9" width="453">  
      <?php
              echo "您好,",$name,"。";
              echo "欢迎您第", $count,"次光临本站。";
      ?>
    </td>
  </tr>
</table>
<table width="755" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="19%" bgcolor="#FFeeFF" valign="top">  
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>  
          <td height="20" background="class/image/redbar.gif">  
            <div align="center" class="yellow12" >同学录</div>
          </td>
        </tr>
        <tr>  
          <td height="19" >  
            <div align="center"><a href="class/address.php" title="最新通讯信息" class="purple" target="_blank">【班通讯录】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center" class="purple" ><a href="class/modify.php" title="修改个人资料" class="purple" target="_blank">【资料修改】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center"  class="purple"><a href="class/upload/uploadphoto.php" title="修改个人资料" class="purple" target="_blank">【上传照片】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="21">  
            <div align="center"><a href="class/classphoto.php"  class="purple" target="_blank" >【班级照片】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center"><a href="class/privatephoto.php" title="展现个人风采" class="purple" target="_blank" >【个人照片】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center"><a href="class/shoolphoto.php" title="唤起你美好回忆" class="purple" target="_blank" >【校园风光】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center"><a href="class/privatenote.php" title="给单个同学留言" class="purple" target="_blank">【私人留言】</a></div>
          </td>
        </tr>
        <tr>  
          <td height="19">  
            <div align="center"><a href="class/notebook/index.php" title="留下你的祝福" class="purple" target="_blank" >【班留言板】</a></div>
          </td>
        </tr>
        <tr bgcolor="#FF99CC">  
          <td height="20" bgcolor="#FF99CC" background="class/image/redbar.gif" >  
            <div align="center" class="yellow12">班级聊天室</div>
          </td>
        </tr>
        <tr>  
          <td height="21">  
            <div align="center" class="purple"> 【进入班级聊天室】 </div>
          </td>
        </tr>
        <tr>  
          <td >  
            <div align="center" class="purple">【班级聊天室帮助】</div>
          </td>
        </tr>
        <tr>  
          <td height="20" background="class/image/redbar.gif">  
            <div align="center" class="yellow12" >友情链接</div>
          </td>
        </tr>
        <tr>  
          <td>  
            <div align="center"><a href="http://www.medguider.com" title="neo的个人主页" target="_blank"><img src="class/image/logo2.gif" width="82" height="31" border=0></a></div>
          </td>
        </tr>
        <tr>  
          <td>  
            <div align="center"><a href="http://www.5460.net" target="_blank"><img src="class/image/a31.gif" width="81" height="33" border="0" alt="国内最好的同学录"></a></div>
          </td>
        </tr>
        <tr>  
          <td height="24">  
            <div align="center" class="purple"><a href="http://medonline.51.net/" class="purple"  target="_blank">杏林医疗在线</a></div>
          </td>
        </tr>
        <tr>  
          <td height="22">  
            <div align="center" ><a href="http://alumni.chinaren.com" title="非常有特色的同学录" class="purple" target="_blank" >ChinaRen校友录</a></div>
          </td>
        </tr>
        <tr>  
          <td height="22" bgcolor="#FFCCFF">  
            <div align="center"><a href="superadmin.php" class="purple" target="_blank">班级管理</a></div>
          </td>
        </tr>
      </table>
    </td>
    <td width="61%" height="308">  
      <div align="center"><img src="class/image/821036.jpg" width="400" height="166" alt="这里换成班级照片"></div>
      <table width="87%" border="1" cellspacing="0" cellpadding="0" align="center" height="109" bordercolorlight="#9999FF" bordercolordark="#FFFFFF">
        <tr>  
          <td>  
            <div align="center" class="redlarge"><b>祝贺词</b> </div>
          </td>
        </tr>
        <tr>  
          <td class="brown9" height="19"><img src="class/image/bz.gif" width="15" height="16">  
            1.欢迎使用杏林同学录。</td>
        </tr>
        <tr>  
          <td class="brown9"><img src="class/image/bz.gif" width="15" height="16">  
            2.如果发现bug,请尽快通知我。</td>
        </tr>
        <tr>  
          <td class="brown9"> <img src="class/image/bz.gif" width="15" height="16">  
            3.技术支持: <a href="mailto:webmaster@medguider.51.net" class="purple">webmaster@medguider.51.net</a></td>
        </tr>
        <tr>  
          <td>  
            <div align="center" class="redlarge"> 最新留言</div>
          </td>
        </tr>
        <tr>  
          <td class="brown9">  
            <?php
   $result = mysql_query("SELECT * FROM notebook",$db);
   $row=mysql_num_rows($result);
   if ($row<=1) {$x=$row;} else {$x=2;}
   $result = mysql_query("select * from notebook ORDER BY time DESC limit 0,$x",$db);//读取最近2条留言
   for ($i=0;$i<=($x-1);$i++) {
   $user=mysql_result($result,$i,'user');
   $resulty=mysql_query("select * from user where user='$user'",$db);
   $name=mysql_result($resulty,0,'name');
   $time=mysql_result($result,$i,'time');
   $title=mysql_result($result,$i,'title');
   $nnote=mysql_result($result,$i,'nnote');
   echo "◆留言人:$name 时间 $time <BR>主题:$title<BR>内容:$nnote<BR>";
    }
          ?>
          </td>
        </tr>
      </table>
    </td>
    <td valign="top" width="20%" bgcolor="#CFBD9B">  
      <table border="0" cellspacing="0" cellpadding="0" width="100%">
        <tr>  
          <td background="class/image/yellowbar3.gif" class="white12" height="19">  
            <div align="center">悄悄话</div>
          </td>
        </tr>
        <tr>  
          <td bgcolor="#FFFEEFF">  
            <div align="center" class="brown9" >  
              <?php
            $result = mysql_query("SELECT * FROM privatenote where touser='$userregister'",$db);
            $row=mysql_num_rows($result);        //悄悄话总数
            $unlook=0;   
              if (!$row==0){
              for ($i=0;$i<$row;$i++){
               $look=mysql_result($result,$i,'look');//计算未看过的悄悄话数目
               if ($look=="0"){$unlook++;}  
              }
              }
            echo "您有".$unlook."条新悄悄话.总共有".$row."条。<a href='class/privatenote.php' target='_blank'>查看悄悄话</a>";                         
            ?>
             </div>
          </td>
        </tr>
        <tr>  
          <td bgcolor="#FFCC66" class="white12" height="20">  
            <div align="center">通讯录名单</div>             
          </td>
        </tr>
        <tr>  
          <td class="brown9" height="77" bgcolor="#FFFEEFF">
          <?
            $result = mysql_query("SELECT * FROM user",$db);
            $row=mysql_num_rows($result);//查看结果有多少行,即成员人数
            for ($i=0;$i<=($row-1);$i++){
             $name=mysql_result($result,$i,'name');
             echo $name,",";
            }
            mysql_close($db);
            ?>
            </td>
        </tr>
        <tr>  
          <td>  

            <table border="0" cellspacing="0" cellpadding="0" bgcolor="#CFBD9B" width="150">
              <tr>  
                <td height="24" colspan="3"><img src="class/image/noticebar.gif" width="150" height="25"></td>
                </tr>
                <tr>  

                <td height="182" width="6%"> </td>

                <td width="88%" bgcolor="#FFFFFF" background="class/image/fanhor01-1.jpg" class="deepblue10"><marquee direction=up scrollamount=1 scrolldelay=130 ><font color="#FFCC66">★</font>本网站已被搜狐、新浪收录<br>
                  <font color="#FFCC66">★</font>感谢leo为我们做的新动画logo.<br>
                  <font color="#FFCC66">★</font>经过数日的努力,终于用php和mysql数据库将新版同学录做好。特点:用户可在线修改资料;上传照片;悄悄话,oicq头像。<br>
                    <font color="#FFCC66">★</font>5460中国同学录上我们班已有14人加入。<br>
                  <font color="#FFCC66">★</font> 如果您有漂亮的扫描好的个人照片,请尽快上传。<br>
                  </marqee>
                  </td>

                <td height="182" width="6%"> </td>
                </tr>
                <tr>  

                <td colspan="3" height="4"> </td>
                </tr>
              </table>                        </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<div align="center">  
  <p class="black9">您是第  
    <?php
//总计数器
$fs = fopen("class/counter.txt","r+");  
$hit = fgets($fs,10);  
$hit+=1;  
rewind($fs);  
fwrite($fs,$hit,10);  
$hit = number_format($hit);  
fclose($fs);
echo "<font color='#33FF00'>$hit</font>";
?>
    位来访者!<br>
    主页制作:<a href="http://www.medguider.com" class="black9">医学导航网</a><br>
    <span class="grey9">本页使用了flash,如果不能正常浏览,请安装<a href="http://medonline.51.net/plugsin/InstallAXFlash.exe">flash插件</a></span></p>
</div>
</BODY>
</HTML>

PHP 相关文章推荐
深入理解PHP原理之Session Gc的一个小概率Notice
Apr 12 PHP
PHP数据类型之布尔型的介绍
Apr 28 PHP
基于header的一些常用指令详解
Jun 06 PHP
对PHP新手的一些建议(PHP学习经验总结)
Aug 20 PHP
ThinkPHP在新浪SAE平台的部署实例
Oct 31 PHP
完美解决thinkphp验证码出错无法显示的方法
Dec 09 PHP
PHP程序员必须清楚的问题汇总
Dec 18 PHP
PHP函数func_num_args用法实例分析
Dec 07 PHP
比较完整的微信开发php代码
Aug 02 PHP
ThinkPHP框架实现定时执行任务的两种方法分析
Sep 04 PHP
PHP实现读取文件夹及批量重命名文件操作示例
Apr 15 PHP
laravel5.1框架model类查询的实现方法
Oct 08 PHP
基于mysql的bbs设计(五)
Oct 09 #PHP
PHP+DBM的同学录程序(5)
Oct 09 #PHP
同时提取多条新闻中的文本一例
Oct 09 #PHP
PHP+DBM的同学录程序(4)
Oct 09 #PHP
PHP+DBM的同学录程序(1)
Oct 09 #PHP
基于mysql的bbs设计(四)
Oct 09 #PHP
PHP+DBM的同学录程序(3)
Oct 09 #PHP
You might like
php 获取可变函数参数的函数
2009/08/26 PHP
PHP项目开发中最常用的自定义函数整理
2010/12/02 PHP
PHP数组实例总结与说明
2011/08/23 PHP
Array of country list in PHP with Zend Framework
2011/10/17 PHP
PHP中iconv函数转码时截断字符问题的解决方法
2015/01/21 PHP
php 字符串中是否包含指定字符串的多种方法
2018/04/12 PHP
让getElementsByName适应IE和firefox的方法
2007/09/24 Javascript
jQuery 扩展对input的一些操作方法
2009/10/30 Javascript
给ListBox添加双击事件示例代码
2013/12/02 Javascript
简单的js图片轮换代码(js图片轮播)
2014/05/06 Javascript
JS中的form.submit()不能提交表单的错误原因
2014/10/08 Javascript
Jquery Ajax xmlhttp请求成功问题
2015/02/04 Javascript
简单实现的JQuery文本框水印插件
2016/06/14 Javascript
JavaScript程序中实现继承特性的方式总结
2016/06/24 Javascript
JavaScript蒙板(model)功能的简单实现代码
2016/08/04 Javascript
AngularJs Forms详解及简单示例
2016/09/01 Javascript
vue+element模态框中新增模态框和删除功能
2019/06/11 Javascript
jQuery实现input[type=file]多图预览上传删除等功能
2019/08/02 jQuery
[00:49]完美世界DOTA2联赛10月28日开团时刻:随便打
2020/10/29 DOTA
Python中函数参数设置及使用的学习笔记
2016/05/03 Python
Python3实现发送QQ邮件功能(附件)
2020/12/23 Python
Python利用ORM控制MongoDB(MongoEngine)的步骤全纪录
2018/09/13 Python
对Python协程之异步同步的区别详解
2019/02/19 Python
简单了解python中的f.b.u.r函数
2019/11/02 Python
Python如何获取Win7,Win10系统缩放大小
2020/01/10 Python
用60行代码实现Python自动抢微信红包
2021/02/04 Python
requests在python中发送请求的实例讲解
2021/02/17 Python
详解CSS3中Media Queries的相关使用
2015/07/17 HTML / CSS
阿联酋团购网站:Groupon阿联酋
2016/10/14 全球购物
Omio中国:全欧洲低价大巴、火车和航班搜索和比价
2018/08/09 全球购物
2014年道德讲堂实施方案
2014/03/05 职场文书
党的群众路线批评与自我批评发言稿
2014/10/16 职场文书
幼儿园家长工作总结2015
2015/04/25 职场文书
如何书写授权委托书?
2019/06/25 职场文书
一文彻底理解js原生语法prototype,__proto__和constructor
2021/10/24 Javascript
「魔导具师妲莉亚永不妥协~从今天开始的自由职人生活~」1、2卷发售宣传CM公开
2022/03/21 日漫