密码查询:class/querypsw.php
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>询问密码</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
include "config.php";
//询问班级注册问题密码
if ($class){
$headers .= "Content-Type: text/html; charset=gb2312n"; // Mime type
$subject="询问班级注册问题密码 "; //主题
$message=nl2br($message);
$message="查询人:".$name."<BR>留言:<BR>".$message; //内容
mail($superemail,$subject,$message,$headers);
echo "恭喜您,您的请求已经向管理员发出,近期内请注意查收email。";
exit;
}
//询问个人注册密码
if ($member){
$result = mysql_query("SELECT * FROM user where user='$username'",$db);
if (mysql_num_rows($result)==0){ //若返回列的数目为0,说明无此资料
echo "我们的数据库中无此用户,请确认。注意大小写。<a href='javascript:history.back()'>返回</a>";
exit;}
$myemail=mysql_result($result,0,"email");//读取user数据库中的email
if (!$myemail){ //如果还没有email,则返回
echo "我们的数据库中没有您的email,请再次填写。<a href='javascript:history.back()'>返回</a>";
exit;
}
$psw=mysql_result($result,0,"psw"); //密码
$name=mysql_result($result,0,"name"); //姓名
$subject="询问个人注册密码";
$message=$name.",您好。您的用户名是".$username.",密码是".$psw."。<BR>-----------------------<BR><a href='".$url."'>".$sitename."</a>"; //信件内容
$headers .= "Content-Type: text/html; charset=gb2312n"; // Mime type
mail($myemail,$subject,$message,$headers);
echo "恭喜您,系统已经向您的信箱中发出了答复信件,请注意查收email。";
exit;
}
?>
<table width="93%" border="0" cellspacing="0" cellpadding="0" align="center" height="286">
<tr>
<td height="75" colspan="2">
<div align="center">询问密码<br>
</div>
</td>
</tr>
<tr>
<td height="75" width="47%">
<form name="form1" method="post" action="<? echo $PHP_SELF;?>"><div align="center">询问班级注册问题答案<br>
您的姓名
<input type="text" name="name">
<br>您的留言(写上能证实您身份的简短留言及email地址)
<textarea name="message" rows="3" cols="50"></textarea>
<br>
系统将向班级管理员发送您的请求,是否确认?<br>
<input type="submit" name="class" value="确认">
<input type="reset" name="cancel" value="重填">
<br>
</div></form>
</td>
<td height="75" width="53%">
<div align="center">
<form name="form2" method="post" action="<? echo $PHP_SELF;?>">
询问个人注册密码<br>
<br>
您的用户名(不是姓名)<br>
<br>
<input type="text" name="username">
<br>
<br>
<br>
系统将会向您注册的信箱中发发送密码,是否确认?<br>
<input type="submit" name="member" value="确认">
<input type="reset" name="cancel2" value="重填">
</form>
</div>
</td>
</tr>
</table>
</BODY>
</HTML>
悄悄话:privatenote.php
<?
session_start(); // 开始session
if(!session_is_registered("userregister")||($userregister==""))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo "<a href='../index.php'>请重新注册<BR>";
exit;
}
//删除留言
include "config.php";
if ($del=="1"){
mysql_query("delete from privatenote where id='$id'",$db); //以id为删除标志
echo "删除成功!";
}
//添加留言
if ($Submit){
$id=time(); //以时间戳为记录号
$time=date("Y年m月d日 h:i:s A");//留言时间
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);
$fromuser=mysql_result($result,0,'name'); //发消息人姓名
$result = mysql_query("SELECT * FROM user where name='$yname'",$db);
$touser=mysql_result($result,0,'user'); ; //接受人用户名
$message=nl2br(strip_tags($ynote));//留言内容
mysql_query("INSERT INTO privatenote (id,fromuser,touser,time,message) values ('$id','$fromuser','$touser','$time','$message')",$db); //写入数据库
echo "留言成功!";
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>悄悄话</TITLE>
<style type="text/css">
<!--
.blue9 { font-size: 10pt; color: #9999FF; text-decoration: none}
.black10 { font-size: 10pt}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<table width="64%" border="1" cellspacing="1" cellpadding="1" align="center" ">
<tr>
<td colspan="2" height="63">
<div align="center"><img src="image/classlogo.gif" width="224" height="60">
</div>
</td>
</tr>
<tr>
<td class="blue9" colspan="2">
<div align="center">
<?
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);
$name=mysql_result($result,0,"name");//姓名
echo $name;
?>
的悄悄话</div>
</td>
</tr>
<tr>
<td class=
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>询问密码</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
include "config.php";
//询问班级注册问题密码
if ($class){
$headers .= "Content-Type: text/html; charset=gb2312n"; // Mime type
$subject="询问班级注册问题密码 "; //主题
$message=nl2br($message);
$message="查询人:".$name."<BR>留言:<BR>".$message; //内容
mail($superemail,$subject,$message,$headers);
echo "恭喜您,您的请求已经向管理员发出,近期内请注意查收email。";
exit;
}
//询问个人注册密码
if ($member){
$result = mysql_query("SELECT * FROM user where user='$username'",$db);
if (mysql_num_rows($result)==0){ //若返回列的数目为0,说明无此资料
echo "我们的数据库中无此用户,请确认。注意大小写。<a href='javascript:history.back()'>返回</a>";
exit;}
$myemail=mysql_result($result,0,"email");//读取user数据库中的email
if (!$myemail){ //如果还没有email,则返回
echo "我们的数据库中没有您的email,请再次填写。<a href='javascript:history.back()'>返回</a>";
exit;
}
$psw=mysql_result($result,0,"psw"); //密码
$name=mysql_result($result,0,"name"); //姓名
$subject="询问个人注册密码";
$message=$name.",您好。您的用户名是".$username.",密码是".$psw."。<BR>-----------------------<BR><a href='".$url."'>".$sitename."</a>"; //信件内容
$headers .= "Content-Type: text/html; charset=gb2312n"; // Mime type
mail($myemail,$subject,$message,$headers);
echo "恭喜您,系统已经向您的信箱中发出了答复信件,请注意查收email。";
exit;
}
?>
<table width="93%" border="0" cellspacing="0" cellpadding="0" align="center" height="286">
<tr>
<td height="75" colspan="2">
<div align="center">询问密码<br>
</div>
</td>
</tr>
<tr>
<td height="75" width="47%">
<form name="form1" method="post" action="<? echo $PHP_SELF;?>"><div align="center">询问班级注册问题答案<br>
您的姓名
<input type="text" name="name">
<br>您的留言(写上能证实您身份的简短留言及email地址)
<textarea name="message" rows="3" cols="50"></textarea>
<br>
系统将向班级管理员发送您的请求,是否确认?<br>
<input type="submit" name="class" value="确认">
<input type="reset" name="cancel" value="重填">
<br>
</div></form>
</td>
<td height="75" width="53%">
<div align="center">
<form name="form2" method="post" action="<? echo $PHP_SELF;?>">
询问个人注册密码<br>
<br>
您的用户名(不是姓名)<br>
<br>
<input type="text" name="username">
<br>
<br>
<br>
系统将会向您注册的信箱中发发送密码,是否确认?<br>
<input type="submit" name="member" value="确认">
<input type="reset" name="cancel2" value="重填">
</form>
</div>
</td>
</tr>
</table>
</BODY>
</HTML>
悄悄话:privatenote.php
<?
session_start(); // 开始session
if(!session_is_registered("userregister")||($userregister==""))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo "<a href='../index.php'>请重新注册<BR>";
exit;
}
//删除留言
include "config.php";
if ($del=="1"){
mysql_query("delete from privatenote where id='$id'",$db); //以id为删除标志
echo "删除成功!";
}
//添加留言
if ($Submit){
$id=time(); //以时间戳为记录号
$time=date("Y年m月d日 h:i:s A");//留言时间
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);
$fromuser=mysql_result($result,0,'name'); //发消息人姓名
$result = mysql_query("SELECT * FROM user where name='$yname'",$db);
$touser=mysql_result($result,0,'user'); ; //接受人用户名
$message=nl2br(strip_tags($ynote));//留言内容
mysql_query("INSERT INTO privatenote (id,fromuser,touser,time,message) values ('$id','$fromuser','$touser','$time','$message')",$db); //写入数据库
echo "留言成功!";
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>悄悄话</TITLE>
<style type="text/css">
<!--
.blue9 { font-size: 10pt; color: #9999FF; text-decoration: none}
.black10 { font-size: 10pt}
-->
</style>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<table width="64%" border="1" cellspacing="1" cellpadding="1" align="center" ">
<tr>
<td colspan="2" height="63">
<div align="center"><img src="image/classlogo.gif" width="224" height="60">
</div>
</td>
</tr>
<tr>
<td class="blue9" colspan="2">
<div align="center">
<?
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);
$name=mysql_result($result,0,"name");//姓名
echo $name;
?>
的悄悄话</div>
</td>
</tr>
<tr>
<td class=