Password query: class/querypsw.php
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE> Ask Password </TITLE>
</HEAD>
<body bgcolor= "#FFFFFF" >
<?php
Include "config.php";
Ask the class registration question password
if ($class) {
$headers. = "content-type:text/html; Charset=gb2312n "; Mime type
$subject = "Ask the class registration question password"; Theme
$message =nl2br ($message);
$message = "Query person:". $name. " <BR> message:<br> ". $message; Content
Mail ($superemail, $subject, $message, $headers);
echo "Congratulations, your request has been sent to the administrator, please check your email in the near future." ";
Exit
}
Ask for a personal registration password
if ($member) {
$result = mysql_query ("SELECT * from user where user= ' $username '", $db);
if (mysql_num_rows ($result) ==0) {//If the number of returned columns is 0, this information is not available
echo "There is no such user in our database, please confirm." Note the case. <a href= ' javascript:history.back () ' > Return </a> ';
Exit;}
$myemail =mysql_result ($result, 0, "email")//Read email from user database
if (! $myemail) {//If there is no email, return
echo "Our database does not have your email, please fill in again." <a href= ' javascript:history.back () ' > Return </a> ';
Exit
}
$PSW =mysql_result ($result, 0, "PSW"); Password
$name =mysql_result ($result, 0, "name"); Name
$subject = "Ask for personal registration password";
$message = $name. ", hello. Your username is ". $username." And the password is ". $psw." <BR>-----------------------<br><a href= ' ". $url." ' > ". $sitename." </a> "; Letter Contents
$headers. = "content-type:text/html; Charset=gb2312n "; Mime type
Mail ($myemail, $subject, $message, $headers);
echo "Congratulations, the system has sent a reply letter to your mailbox, please check your email." ";
Exit
}
?>
<table width= "93%" border= "0" cellspacing= "0" cellpadding= "0" align= "center" height= "286" >
<tr>
<TD height= "A" colspan= "2" >
<div align= "center" > Ask Password <br>
</div>
</td>
</tr>
<tr>
<TD height= "width=" "47%" >
<form name= "Form1" method= "Post" action= " echo $PHP _self;? > "><div align=" center > Ask the answer to the class registration question <br>
Your name
<input type= "text" name= "name" >
<br> your message (write a short message and email address that confirms your identity)
<textarea name= "Message" rows= "3" cols= "M" ></textarea>
<br>
The system will send your request to the class administrator to confirm the?<br>
<input type= "Submit" Name= "class" value= "Confirmation" >
<input type= "reset" name= "Cancel" value= "re-fill" >
<br>
</div></form>
</td>
<TD height= "width=" "53%" >
<div align= "center" >
<form name= "Form2" method= "POST" action= " echo $PHP _self;? > ">
Ask for a personal registration password <br>
<br>
Your user name (not the name) <br>
<br>
<input type= "text" name= "username" >
<br>
<br>
<br>
The system will send a password to your registered mailbox, is it confirmed? <br>
<input type= "Submit" Name= "Member" value= "Confirmation" >
<input type= "reset" name= "Cancel2" value= "refill" >
</form>
</div>
</td>
</tr>
</table>
</BODY>
</HTML>
Whisper: privatenote.php
?
Session_Start (); Start session
if (!session_is_registered ("Userregister") | | ($userregister = = "")) Check whether registration, such as Userregister or session is null, re-register.
{
echo "<a href=". /index.php ' > Please re-register <BR> ';
Exit
}
Delete message
Include "config.php";
if ($del = = "1") {
mysql_query ("Delete from privatenote where id= ' $id '", $db); Delete flag with ID
echo "Delete success!" ";
}
Add a message
if ($Submit) {
$id =time (); Time stamp as record number
$time =date ("Y-year m-month D-day h:i:s A");/Message Time
$result = mysql_query ("SELECT * from user where user= ' $userregister '", $db);
$fromuser =mysql_result ($result, 0, ' name '); Send a message person name
$result = mysql_query ("SELECT * from user where name= ' $yname '", $db);
$touser =mysql_result ($result, 0, ' user '); Recipient User Name
$message =nl2br (Strip_tags ($ynote))/message content
mysql_query ("INSERT into Privatenote" (id,fromuser,touser,time,message) VALUES (' $id ', ' $fromuser ', ' $touser ', ' $time ', ' $message '), $db); Writing to the database
echo "Message success!" ";
}
?>
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE> Whisper </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= ">"
<div align= "center" >
</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");//Name
Echo $name;
?>
The Whispering </div>
</td>
</tr>
<tr>
<TD class= "Blue9" colspan= "2" >
<?php
$result = mysql_query ("select * from Privatenote where touser= ' $userregister ' ORDER by Time DESC", $db);
$row =mysql_num_rows ($result); Total number of Whispers
$unlook = 0;
if (! $row ==0) {
for ($i =0; $i < $row; $i + +) {
$id =mysql_result ($result, $i, ' id ');/message ID
$fromuser =mysql_result ($result, $i, ' fromuser ');//Name of message person
$time =mysql_result ($result, $i, ' time '); Message time
$message =mysql_result ($result, $i, ' message '); Message content
$look _s= "have seen"; Comments
$look =mysql_result ($result, $i, ' look '); Have you ever seen
if ($look = = "0") {$unlook + +; $look _s= "have not seen";}//Calculate the number of unseen whispers and change the annotation
mysql_query ("UPDATE privatenote SET look= ' 1 ' where id= ' $id '", $db); Read the secret message and change it to 1.
echo "section", $i +1, "article issued by:", $fromuser, "Message time:", $time, "<BR>";
echo "Message content:", $message, "<BR>------", $look _s;
echo "<a href= ' $PHP _self?del=1&id= $id ' > Remove </a><HR>";
}
}
echo "The total number of whispers:", $row, ".", $unlook, "a new whisper."
?>
</td>
</tr>
<tr>
<TD class= "Black10" colspan= "2" >
<form method= "POST" action= "<?php echo $PHP _self;? > ">
<p align= "center" > Who are you whispering to?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service