Home  >  Article  >  Backend Development  >  Xinglin classmate record 2

Xinglin classmate record 2

WBOY
WBOYOriginal
2016-07-29 08:33:591279browse

成员主页: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);
?>



欢迎来到杏林同学录




    
    
    
  
  
      
同学录  
      

    

        
        
        
          
      


    
    
    
  
北京时间  
      
    
  
       echo "您好,",$name,"。";
echo "欢迎您第", $count,"次光临本站。";
?>
    


  
    
    
    
  
  
      
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
  
            
同学录

          
  
            
          
  
            
          
  
            
          
  
            
          
  
            
          
  
            
          
  
            
          
  
            
          
  
            
班级聊天室

          
  
            
【进入班级聊天室】

          
  
            
【班级聊天室帮助】

          
  
            
友情链接

          
  
            

          
  
            
国内最好的同学录

          
  
            
          
  
            
          
  
            
          

    
  
      
这里换成班级照片

      
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
  
            
祝贺词

          
  
            1.欢迎使用杏林同学录。
  
            2.如果发现bug,请尽快通知我。
  
            3.技术支持: webmaster@medguider.51.net
  
            
最新留言

          
  
             $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
主题:$title
内容:$nnote
";
    }
          ?>
          

    
  
      
          
          
        
          
          
        
          
          
        
          
          
        
          
          
        
      
  
            
悄悄话

          
  
            
  
               $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."条。查看悄悄话";                         
            ?>
             

          
  
            
通讯录名单
             
          

                      $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);
            ?>
            
  
            
                
                
                
                  
                
                
                
                
                  
                
                
              
  本网站已被搜狐、新浪收录

                  感谢leo为我们做的新动画logo.

                  经过数日的努力,终于用php和mysql数据库将新版同学录做好。特点:用户可在线修改资料;上传照片;悄悄话,oicq头像。

                    5460中国同学录上我们班已有14人加入。

                   如果您有漂亮的扫描好的个人照片,请尽快上传。

                  
                  
 
 
                        

    

  
  

您是第  
    //总计数器
$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 "$hit";
?>
    位来访者!

    主页制作:医学导航网

    本页使用了flash,如果不能正常浏览,请安装flash插件





以上就介绍了 杏林同学录二,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn