Xinglin record (5)

Source: Internet
Author: User
Xinlin record (5) password query: class/querypsw. php



Ask for password


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"; // subject
$ Message = nl2br ($ message );
$ Message = "queried by:". $ name ."
Message:
". $ 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 your 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 document is not provided.
Echo "this user is not in our database. Please confirm. Note the case sensitivity. Return ";
Exit ;}
$ Myemail = mysql_result ($ result, 0, "email"); // read the email in the user database
If (! $ Myemail) {// if no email is available, return
Echo "our database does not contain your email. please enter it again. Return ";
Exit;
}
$ Psw = mysql_result ($ result, 0, "psw"); // password
$ Name = mysql_result ($ result, 0, "name"); // name
$ Subject = "ask your personal registration password ";
$ Message = $ name. ", hello. Your username is ". $ username." and the password is ". $ psw .".
-----------------------
". $ Sitename." "; // mail content
$ 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;
}
?>









Ask for password












Whisper: privatenote. php
Session_start (); // start session
If (! Session_is_registered ("userregister") | ($ userregister = "") // check whether it is registered. if userregister is not registered or the session is null, register it again.
{
Echo "please register again
";
Exit;
}
// Delete the message
Include "config. php ";
If ($ del = "1 "){
Mysql_query ("delete from privatenote where id = '$ ID'", $ db); // use id as the delete flag
Echo "deleted successfully! ";
}
// Add a message
If ($ Submit ){
$ Id = time (); // use the timestamp as the record number
$ Time = date ("Y, m, d, h: I: s A"); // message time
$ Result = mysql_query ("SELECT * FROM user where user = '$ userregister'", $ db );
$ Fromuser = mysql_result ($ result, 0, 'name'); // sender name
$ Result = mysql_query ("SELECT * FROM user where name = '$ yname'", $ db );
$ Touser = mysql_result ($ result, 0, 'User'); // username of the recipient
$ Message = nl2br (strip_tags ($ ynote); // message content
Mysql_query ("insert into privatenote (id, fromuser, touser, time, message) values ('$ ID',' $ fromuser', '$ touser',' $ time ', '$ message') ", $ db); // write data to the database
Echo "message successful! ";
}
?>



Whisper





















$ Result = mysql_query ("SELECT * FROM user where user = '$ userregister'", $ db );
$ Name = mysql_result ($ result, 0, "name"); // name
Echo $ name;
?>
Whisper



$ 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'); // The name of the contact.
$ Time = mysql_result ($ result, $ I, 'time'); // message time
$ Message = mysql_result ($ result, $ I, 'message'); // message content
$ Look_s = "viewed"; // comment
$ Look = mysql_result ($ result, $ I, 'Look'); // whether to view
If ($ look = "0") {$ unlook ++; $ look_s = "not viewed";} // calculates the number of private messages that have not been viewed, and changes the comment
Mysql_query ("UPDATE privatenote SET look = '1' where id = '$ ID'", $ db); // change the status of the session to 1
Echo "no.", $ I + 1, "Sender:", $ fromuser, "message time:", $ time ,"
";
Echo "message content:", $ message ,"
------ ", $ Look_s;
Echo "delete ";
}
}
Echo "total number of whispers:", $ row, ".", $ unlook, "New whispers .";
?>




Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.