当前位置: 编程技术>php
本页文章导读:
▪php访问查询mysql数据的三种方法
1. $row = mysql_fetch_row($result); 返回一个规则的数组$row,$row[0]是第一个元素,$row[1]是第二个元素,依次类推... mysql_num_fields($result) 返回结果的元素个数。 2. $row = mysql_fetch_array($result); 返回一个数组.........
▪杏林同学录(一)
主要特点: php+mysql,session页面保护,悄悄话功能,照片上传,在线修改资料,email查询及自动回复,客人模式, 方便的班级管理 程序清单: 配置部分: 配置文件:class/config.p.........
▪杏林同学录(二)
成员主页: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.........
[1]php访问查询mysql数据的三种方法
来源: 互联网 发布时间: 2013-11-30
1. $row = mysql_fetch_row($result);
返回一个规则的数组$row,$row[0]是第一个元素,$row[1]是第二个元素,依次类推...
mysql_num_fields($result) 返回结果的元素个数。
2. $row = mysql_fetch_array($result);
返回一个数组$row. 举例如下:
表结构如下:
username | password
-------------------------------------
bourbon | abc
berber | efg
第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:
$row[0] = $row["username"] = "bourbon"
$row[1] = $row["password"] = "abc"
第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:
$row[0] = $row["username"] = "berber"
$row[1] = $row["password"] = "efg"
3. $row = mysql_fetch_object($result);
返回一个对象描述行. 如上例
第一次运行运行$row = mysql_fetch_object($result) 则结果如下:
$row->username = "bourbon"
$row->password = "abc"
第二次运行运行$row = mysql_fetch_object($result) 则结果如下:
$row->username = "berber"
$row->password = "efg"
返回一个规则的数组$row,$row[0]是第一个元素,$row[1]是第二个元素,依次类推...
mysql_num_fields($result) 返回结果的元素个数。
2. $row = mysql_fetch_array($result);
返回一个数组$row. 举例如下:
表结构如下:
username | password
-------------------------------------
bourbon | abc
berber | efg
第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:
$row[0] = $row["username"] = "bourbon"
$row[1] = $row["password"] = "abc"
第一次运行运行 $row = mysql_fetch_array($result) 则结果如下:
$row[0] = $row["username"] = "berber"
$row[1] = $row["password"] = "efg"
3. $row = mysql_fetch_object($result);
返回一个对象描述行. 如上例
第一次运行运行$row = mysql_fetch_object($result) 则结果如下:
$row->username = "bourbon"
$row->password = "abc"
第二次运行运行$row = mysql_fetch_object($result) 则结果如下:
$row->username = "berber"
$row->password = "efg"
[2]杏林同学录(一)
来源: 互联网 发布时间: 2013-11-30
主要特点:
php+mysql,session页面保护,悄悄话功能,照片上传,在线修改资料,email查询及自动回复,客人模式,
方便的班级管理
程序清单:
配置部分:
配置文件:class/config.php 数据库文件:class/mysql.txt 计数器文件:class/counter.txt
主程序:
登陆首页:index.php 成员主页:main.php 客人主页:class/guest.php
个人管理:
班级通讯录:class/address.php 个人资料修改:class/modify.php 上传照片:class/uploadphoto.php
密码查询:class/querypsw.php 悄悄话:privatenote.php
注册部分:
注册步骤1: class/register_step1.php 注册步骤2: class/register_step2.php
照片部分:
班级照片:class/classphoto.php 学校照片:class/schoolphoto.php 个人照片:class/privatephoto.php
留言簿部分:
班级成员留言簿: 显示留言:class/notebook/index.php 添加留言:class/notebook/addnote.php
客人留言簿: 显示留言:class/notebookg/index.php 添加留言:class/notebookg/addnote.php
班级管理部分:
首页:superadmin.php 添加成员:class/admin/addmember.php 显示、删除成员:class/admin/member.php
修改成员资料:class/admin/editmember.php 修改成员资料步骤2:class/admin/editmember_step2.php
班级成员留言簿管理: class/notebook/delnote.php 客人留言簿管理: class/notebookg/delnote.php
其它:
帮助文件:readme.txt 图片:class/image
注意事项:
1.先将配置文件config.php改好再上传,按照mysql.txt内容建立数据库。
2.上传时将counter.txt的属性改为777
3.照片上传程序在某些主页空间无法实现,大家试试51.net吧,注意保留class/upload/image目录。
4.在本机调试时,mail()函数可能会出错,不必理它,上传到服务器即可。
5.由于时间仓促,也考虑到照片上传不容易在个人主页实现,班级照片、个人照片等页面请大家自己修改吧。
6.本人初学php,程序尚需进一步完善,本程序仅供菜鸟参考。
程序示例:http://medguider.host.wayall.com/
联系方式:webmaster@medguider.51.net
由于程序代码太多,这里只贴出部分重要代码。完整程序请到我的主页下载:http://www.medguider.com
配置部分:
数据库文件:class/mysql.txt
create table user (id char(2),user char(12),psw char(8),name char(8),sex char(2),birth char(10),work varchar(50),ad varchar(50),post char(6),ph varchar(30),bp varchar(20),email varchar(35),oicq char(12),photo varchar(255),account varchar(255),count int(4) default '1',signature varchar(255),face int(2));
//成员资料表 id 记录号 user 用户名 psw 密码 name 姓名 sex 性别 birth 生日 work 工作单位 ad 通讯地址 post 邮编 ph 电话 bp 传呼 email 电子信箱 oicq oicq count 计数默认值为1
photo 个人照片 account 个人说明 signature 个人签名 face 头像(default=1)
create table notebook (user char(12),time char(30),ip varchar(16),title varchar(255),nnote text);
//班级成员留言簿 user 用户名 time 时间 ip title 标题 nnote 内容
create table notebookg (name char(8),email varchar(35),time char(30),face char(2),ip varchar(16),title varchar(255),nnote text);
//访客留言簿 name 姓名 email time 时间 face 头像 ip title 标题 nnote 内容
create table privatenote (id char(10),fromuser char(12),touser char(12),time char(30),message text,look char(1) default '0');
//悄悄话 id 记录号 fromuser 发消息人姓名 touser 接受人用户名 time 发出时间 message 信息 look 是否看过,默认值为0
配置文件:class/config.php
<?php
$sitename="杏林同学录"; //站点名
$url="http://medguider.host.wayall.com/"; //站点url
$db = mysql_connect("localhost", "root");//这里改为您的mysql用户名密码
mysql_select_db("test",$db);
$supervisor="demo"; //超级管理员名
$superpsw="demo"; //超级管理员密码
$superemail="demo@demo.com";//超级管理员email
$question1="demo"; //注册提示问题1
$answer1="demo"; //注册提示答案1
$question2="demo"; //注册提示问题2
$answer2="demo"; //注册提示答案2
?>
主程序:
登陆首页:index.php
<html>
<head>
<title>班级成员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<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}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="75%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center"><img src="/blog_article/class/image/classlogo.gif" width="224" height="60"></div>
</td>
</tr>
<tr>
<td height="48"> </td>
</tr>
<tr>
<td>
<table width="75%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#FF9900" bordercolordark="#FFFFFF" >
<tr>
<td colspan="2">
<div align="center"></div>
</td>
</tr>
<tr>
<td width="33%" height="17">
<div align="center">班级成员登录 </div>
</td>
<td width="67%" height="17">
<div align="center"><a href="/blog_article/class/register_step1.html" >班级成员注册</a></div>
</td>
</tr>
<tr>
<td width="33%" rowspan="2">
<form method="post" action="/blog_article/main.html">
<div align="center">用户名
<input type="text" name="username" size="8" maxlength="8">
<br>
密码
<input type="password" name="userpsw" size="8" maxlength="8">
<br>
<br>
<input type="submit" name="Submit" value="登录">
<input type="reset" name="cancel" value="重写">
</div>
</form>
</td>
<td width="67%" height="21">
<div align="center"><a href="/blog_article/class/guest.html">客人访问</a></div>
</td>
</tr>
<tr>
<td width="67%">
<div align="center">
<p>忘了密码:<a href="/blog_article/class/querypsw.html" >向管理员索要密码</a><br>
</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
php+mysql,session页面保护,悄悄话功能,照片上传,在线修改资料,email查询及自动回复,客人模式,
方便的班级管理
程序清单:
配置部分:
配置文件:class/config.php 数据库文件:class/mysql.txt 计数器文件:class/counter.txt
主程序:
登陆首页:index.php 成员主页:main.php 客人主页:class/guest.php
个人管理:
班级通讯录:class/address.php 个人资料修改:class/modify.php 上传照片:class/uploadphoto.php
密码查询:class/querypsw.php 悄悄话:privatenote.php
注册部分:
注册步骤1: class/register_step1.php 注册步骤2: class/register_step2.php
照片部分:
班级照片:class/classphoto.php 学校照片:class/schoolphoto.php 个人照片:class/privatephoto.php
留言簿部分:
班级成员留言簿: 显示留言:class/notebook/index.php 添加留言:class/notebook/addnote.php
客人留言簿: 显示留言:class/notebookg/index.php 添加留言:class/notebookg/addnote.php
班级管理部分:
首页:superadmin.php 添加成员:class/admin/addmember.php 显示、删除成员:class/admin/member.php
修改成员资料:class/admin/editmember.php 修改成员资料步骤2:class/admin/editmember_step2.php
班级成员留言簿管理: class/notebook/delnote.php 客人留言簿管理: class/notebookg/delnote.php
其它:
帮助文件:readme.txt 图片:class/image
注意事项:
1.先将配置文件config.php改好再上传,按照mysql.txt内容建立数据库。
2.上传时将counter.txt的属性改为777
3.照片上传程序在某些主页空间无法实现,大家试试51.net吧,注意保留class/upload/image目录。
4.在本机调试时,mail()函数可能会出错,不必理它,上传到服务器即可。
5.由于时间仓促,也考虑到照片上传不容易在个人主页实现,班级照片、个人照片等页面请大家自己修改吧。
6.本人初学php,程序尚需进一步完善,本程序仅供菜鸟参考。
程序示例:http://medguider.host.wayall.com/
联系方式:webmaster@medguider.51.net
由于程序代码太多,这里只贴出部分重要代码。完整程序请到我的主页下载:http://www.medguider.com
配置部分:
数据库文件:class/mysql.txt
create table user (id char(2),user char(12),psw char(8),name char(8),sex char(2),birth char(10),work varchar(50),ad varchar(50),post char(6),ph varchar(30),bp varchar(20),email varchar(35),oicq char(12),photo varchar(255),account varchar(255),count int(4) default '1',signature varchar(255),face int(2));
//成员资料表 id 记录号 user 用户名 psw 密码 name 姓名 sex 性别 birth 生日 work 工作单位 ad 通讯地址 post 邮编 ph 电话 bp 传呼 email 电子信箱 oicq oicq count 计数默认值为1
photo 个人照片 account 个人说明 signature 个人签名 face 头像(default=1)
create table notebook (user char(12),time char(30),ip varchar(16),title varchar(255),nnote text);
//班级成员留言簿 user 用户名 time 时间 ip title 标题 nnote 内容
create table notebookg (name char(8),email varchar(35),time char(30),face char(2),ip varchar(16),title varchar(255),nnote text);
//访客留言簿 name 姓名 email time 时间 face 头像 ip title 标题 nnote 内容
create table privatenote (id char(10),fromuser char(12),touser char(12),time char(30),message text,look char(1) default '0');
//悄悄话 id 记录号 fromuser 发消息人姓名 touser 接受人用户名 time 发出时间 message 信息 look 是否看过,默认值为0
配置文件:class/config.php
<?php
$sitename="杏林同学录"; //站点名
$url="http://medguider.host.wayall.com/"; //站点url
$db = mysql_connect("localhost", "root");//这里改为您的mysql用户名密码
mysql_select_db("test",$db);
$supervisor="demo"; //超级管理员名
$superpsw="demo"; //超级管理员密码
$superemail="demo@demo.com";//超级管理员email
$question1="demo"; //注册提示问题1
$answer1="demo"; //注册提示答案1
$question2="demo"; //注册提示问题2
$answer2="demo"; //注册提示答案2
?>
主程序:
登陆首页:index.php
<html>
<head>
<title>班级成员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<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}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table width="75%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center"><img src="/blog_article/class/image/classlogo.gif" width="224" height="60"></div>
</td>
</tr>
<tr>
<td height="48"> </td>
</tr>
<tr>
<td>
<table width="75%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#FF9900" bordercolordark="#FFFFFF" >
<tr>
<td colspan="2">
<div align="center"></div>
</td>
</tr>
<tr>
<td width="33%" height="17">
<div align="center">班级成员登录 </div>
</td>
<td width="67%" height="17">
<div align="center"><a href="/blog_article/class/register_step1.html" >班级成员注册</a></div>
</td>
</tr>
<tr>
<td width="33%" rowspan="2">
<form method="post" action="/blog_article/main.html">
<div align="center">用户名
<input type="text" name="username" size="8" maxlength="8">
<br>
密码
<input type="password" name="userpsw" size="8" maxlength="8">
<br>
<br>
<input type="submit" name="Submit" value="登录">
<input type="reset" name="cancel" value="重写">
</div>
</form>
</td>
<td width="67%" height="21">
<div align="center"><a href="/blog_article/class/guest.html">客人访问</a></div>
</td>
</tr>
<tr>
<td width="67%">
<div align="center">
<p>忘了密码:<a href="/blog_article/class/querypsw.html" >向管理员索要密码</a><br>
</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
[3]杏林同学录(二)
来源: 互联网 发布时间: 2013-11-30
成员主页: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="/blog_article/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="/blog_article/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 width="302"> 北京时间
<? echo date("Y年m月d日");?>
</td>
<td 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" >同学录</div>
</td>
</tr>
<tr>
<td height="19" >
<div align="center"><a href="/blog_article/class/address.html" title="最新通讯信息" target="_blank">【班通讯录】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center" ><a href="/blog_article/class/modify.html" title="修改个人资料" target="_blank">【资料修改】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center" ><a href="/blog_article/class/upload/uploadphoto.html" title="修改个人资料" target="_blank">【上传照片】</a></div>
</td>
</tr>
<tr>
<td height="21">
<div align="center"><a href="/blog_article/class/classphoto.html" target="_blank" >【班级照片】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/privatephoto.html" title="展现个人风采" target="_blank" >【个人照片】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/shoolphoto.html" title="唤起你美好回忆" target="_blank" >【校园风光】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/privatenote.html" title="给单个同学留言" target="_blank">【私人留言】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/notebook/index.html" title="留下你的祝福" target="_blank" >【班留言板】</a></div>
</td>
</tr>
<tr bgcolor="#FF99CC">
<td height="20" bgcolor="#FF99CC" background="class/image/redbar.gif" >
<div align="center" >班级聊天室</div>
</td>
</tr>
<tr>
<td height="21">
<div align="center" > 【进入班级聊天室】 </div>
</td>
</tr>
<tr>
<td >
<div align="center" >【班级聊天室帮助】</div>
</td>
</tr>
<tr>
<td height="20" background="class/image/redbar.gif">
<div align="center" >友情链接</div>
</td>
</tr>
<tr>
<td>
<div align="center"><a href="http://www.medguider.com" title="neo的个人主页" target="_blank"><img src="/blog_article/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="/blog_article/class/image/a31.gif" width="81" height="33" border="0" alt="国内最好的同学录"></a></div>
</td>
</tr>
<tr>
<td height="24">
<div align="center" ><a href="http://medonline.51.net/" target="_blank">杏林医疗在线</a></div>
</td>
</tr>
<tr>
<td height="22">
<div align="center" ><a href="http://alumni.chinaren.com" title="非常有特色的同学录" target="_blank" >ChinaRen校友录</a></div>
</td>
</tr>
<tr>
<td height="22" bgcolor="#FFCCFF">
<div align="center"><a href="/blog_article/superadmin.html" target="_blank">班级管理</a></div>
</td>
</tr>
</table>
</td>
<td width="61%" height="308">
<div align="center"><img src="/blog_article/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" ><b>祝贺词</b> </div>
</td>
</tr>
<tr>
<td height="19"><img src="/blog_article/class/image/bz.gif" width="15" height="16">
1.欢迎使用杏林同学录。</td>
</tr>
<tr>
<td ><img src="/blog_article/class/image/bz.gif" width="15" height="16">
2.如果发现bug,请尽快通知我。</td>
</tr>
<tr>
<td > <img src="/blog_article/class/image/bz.gif" width="15" height="16">
3.技术支持: <a href="mailto:webmaster@medguider.51.net" >webmaster@medguider.51.net</a></td>
</tr>
<tr>
<td>
<div align="center" > 最新留言</div>
</td>
</tr>
<tr>
<td >
<?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" height="19">
<div align="center">悄悄话</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFEEFF">
<div align="center" >
<?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" height="20">
<div align="center">通讯录名单</div>
</td>
</tr>
<tr>
<td 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="/blog_article/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" ><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 >您是第
<?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" >医学导航网</a><br>
<span >本页使用了flash,如果不能正常浏览,请安装<a href="http://medonline.51.net/plugsin/InstallAXFlash.exe">flash插件</a></span></p>
</div>
</BODY>
</HTML>
<?
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="/blog_article/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="/blog_article/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 width="302"> 北京时间
<? echo date("Y年m月d日");?>
</td>
<td 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" >同学录</div>
</td>
</tr>
<tr>
<td height="19" >
<div align="center"><a href="/blog_article/class/address.html" title="最新通讯信息" target="_blank">【班通讯录】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center" ><a href="/blog_article/class/modify.html" title="修改个人资料" target="_blank">【资料修改】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center" ><a href="/blog_article/class/upload/uploadphoto.html" title="修改个人资料" target="_blank">【上传照片】</a></div>
</td>
</tr>
<tr>
<td height="21">
<div align="center"><a href="/blog_article/class/classphoto.html" target="_blank" >【班级照片】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/privatephoto.html" title="展现个人风采" target="_blank" >【个人照片】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/shoolphoto.html" title="唤起你美好回忆" target="_blank" >【校园风光】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/privatenote.html" title="给单个同学留言" target="_blank">【私人留言】</a></div>
</td>
</tr>
<tr>
<td height="19">
<div align="center"><a href="/blog_article/class/notebook/index.html" title="留下你的祝福" target="_blank" >【班留言板】</a></div>
</td>
</tr>
<tr bgcolor="#FF99CC">
<td height="20" bgcolor="#FF99CC" background="class/image/redbar.gif" >
<div align="center" >班级聊天室</div>
</td>
</tr>
<tr>
<td height="21">
<div align="center" > 【进入班级聊天室】 </div>
</td>
</tr>
<tr>
<td >
<div align="center" >【班级聊天室帮助】</div>
</td>
</tr>
<tr>
<td height="20" background="class/image/redbar.gif">
<div align="center" >友情链接</div>
</td>
</tr>
<tr>
<td>
<div align="center"><a href="http://www.medguider.com" title="neo的个人主页" target="_blank"><img src="/blog_article/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="/blog_article/class/image/a31.gif" width="81" height="33" border="0" alt="国内最好的同学录"></a></div>
</td>
</tr>
<tr>
<td height="24">
<div align="center" ><a href="http://medonline.51.net/" target="_blank">杏林医疗在线</a></div>
</td>
</tr>
<tr>
<td height="22">
<div align="center" ><a href="http://alumni.chinaren.com" title="非常有特色的同学录" target="_blank" >ChinaRen校友录</a></div>
</td>
</tr>
<tr>
<td height="22" bgcolor="#FFCCFF">
<div align="center"><a href="/blog_article/superadmin.html" target="_blank">班级管理</a></div>
</td>
</tr>
</table>
</td>
<td width="61%" height="308">
<div align="center"><img src="/blog_article/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" ><b>祝贺词</b> </div>
</td>
</tr>
<tr>
<td height="19"><img src="/blog_article/class/image/bz.gif" width="15" height="16">
1.欢迎使用杏林同学录。</td>
</tr>
<tr>
<td ><img src="/blog_article/class/image/bz.gif" width="15" height="16">
2.如果发现bug,请尽快通知我。</td>
</tr>
<tr>
<td > <img src="/blog_article/class/image/bz.gif" width="15" height="16">
3.技术支持: <a href="mailto:webmaster@medguider.51.net" >webmaster@medguider.51.net</a></td>
</tr>
<tr>
<td>
<div align="center" > 最新留言</div>
</td>
</tr>
<tr>
<td >
<?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" height="19">
<div align="center">悄悄话</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFEEFF">
<div align="center" >
<?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" height="20">
<div align="center">通讯录名单</div>
</td>
</tr>
<tr>
<td 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="/blog_article/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" ><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 >您是第
<?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" >医学导航网</a><br>
<span >本页使用了flash,如果不能正常浏览,请安装<a href="http://medonline.51.net/plugsin/InstallAXFlash.exe">flash插件</a></span></p>
</div>
</BODY>
</HTML>
最新技术文章: