Xinglin Yinlu (9) class member message book management: class/notebook/delnote. php
Session_start ();
If (! Session_is_registered ("superlogin") // Check for registration
{
Echo "please log on as administrator again
";
Exit;
}
Include ("../config. php ");
If ($ del = 1) {// determine whether to delete
Mysql_query ("delete from notebook where time = '$ time'", $ db); // use the message time as the delete flag
Echo "deleted successfully! ";
}
?>
Delete message
$ Result = mysql_query ("SELECT * FROM notebook", $ db );
$ Row = mysql_num_rows ($ result); // Check the number of rows in the result.
$ Max = $ row; // total number of posts
// Set 10 entries per page, total number of pages of $ p, number of pages of $ page, starting with the row where $ low reads, and number of rows read by $ x
If (! $ Page) {$ page = 1 ;}
$ P = ceil ($ max/10 );
$ Low = 10 * ($ page-1 );
If ($ page = $ p & ($ max % 10) <> 0) {$ x = ($ max % 10);} else {$ x = 10 ;} // if the last page is not an integer multiple of 10, read the remainder of $ max divided by 10. Otherwise, take 10.
If ($ max = 0) {$ x = 0;} // if there is no post, set $ x to 0.
$ Result = mysql_query ("select * from notebook order by time DESC limit $ low, $ x", $ db );
?>
Homepage > Message book |
Echo "total number of posts:", $ max, "no "; For ($ n = 1; $ n <= $ p; $ n ++ ){ Echo "$ n "; } Echo "page "; ?> |
View messages |
For ($ I = 0; $ I <= ($ X-1); $ I ++ ){ $ User = mysql_result ($ result, $ I, 'User '); $ Time = mysql_result ($ result, $ I, 'time '); $ Ip = mysql_result ($ result, $ I, 'IP '); $ Title = mysql_result ($ result, $ I, 'title '); $ Nnote = mysql_result ($ result, $ I, 'note '); $ Yresult = mysql_query ("SELECT * FROM user where user = '$ user'", $ db); // read the member database $ Name = mysql_result ($ yresult, 0, 'name '); $ Signature = mysql_result ($ yresult, 0, 'signature'); // read the personal signature $ Email = mysql_result ($ yresult, 0, 'Email '); $ Face = mysql_result ($ yresult, 0, 'face '); $ Face = '../image/face/icon'. $ face; Echo"
";Echo"
| ";Echo"
Contact: $ name | ";Echo"
Posted at: $ time | ";Echo"
| ";Echo"
$ Ip |
";Echo"
Title: $ title |
";Echo"
Message content: $ nnote |
"; } Mysql_close ($ db ); ?> |
Guest message book management: class/notebookg/delnote. php
Session_start ();
If (! Session_is_registered ("superlogin") // Check for registration
{
Echo "please log on as administrator again
";
Exit;
}
Include ("../config. php ");
If ($ del = 1) {// determine whether to delete
Mysql_query ("delete from notebookg where time = '$ time'", $ db); // indicates the deletion time.
Echo "deleted successfully! ";
}
?>
Delete message
$ Result = mysql_query ("SELECT * FROM notebookg", $ db );
$ Row = mysql_num_rows ($ result); // Check the number of rows in the result.
$ Max = $ row; // total number of posts
// Set 10 entries per page, total number of pages of $ p, number of pages of $ page, starting with the row where $ low reads, and number of rows read by $ x
If (! $ Page) {$ page = 1 ;}
$ P = ceil ($ max/10 );
$ Low = 10 * ($ page-1 );
If ($ page = $ p & ($ max % 10) <> 0) {$ x = ($ max % 10);} else {$ x = 10 ;} // if the last page is not an integer multiple of 10, read the remainder of $ max divided by 10. Otherwise, take 10.
If ($ max = 0) {$ x = 0;} // if there is no post, set $ x to 0.
$ Result = mysql_query ("select * from notebookg order by time DESC limit $ low, $ x", $ db );
?>
Homepage > Message book |
Echo "total number of posts:", $ max, "no "; For ($ n = 1; $ n <= $ p; $ n ++ ){ Echo "$ n "; } Echo "page "; ?> |
View messages |
For ($ I = 0; $ I <= ($ X-1); $ I ++ ){ $ Email = mysql_result ($ result, $ I, 'Email '); $ Face = mysql_result ($ result, $ I, 'face '); $ Face = '../image/face/icon'. $ face; $ Name = mysql_result ($ result, $ I, 'name '); $ Time = mysql_result ($ result, $ I, 'time '); $ Ip = mysql_result ($ result, $ I, 'IP '); $ Title = mysql_result ($ result, $ I, 'title '); $ Nnote = mysql_result ($ result, $ I, 'note '); Echo"
";Echo"
| ";Echo"
Contact: $ name | ";Echo"
Posted at: $ time | ";Echo"
| ";Echo"
$ Ip |
";Echo"
Title: $ title |
";Echo"
Message content: $ nnote |
"; } Mysql_close ($ db ); ?> |