Home > Article > Backend Development > Xinglin classmate record 2
成员主页: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 date("Y年m月d日");?> | echo "您好,",$name,"。"; echo "欢迎您第", $count,"次光临本站。"; ?> |
|
|
|
您是第
//总计数器
$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教程有兴趣的朋友有所帮助。