Support for oicq headers (1)

Source: Internet
Author: User
Support for oicq headers (1) features:
Supports the oicq profile picture, automatic paging, display the ip address of the contact, and verify the validity of the email to facilitate secure message management,
Without complex functions, beginners can easily understand them.
Program example: http://medguider.51.net/notebook/
Complete program download (including pictures) http://medguider.51.net/download/notebook.zip
Program list:
Config. php configuration file mysql.txt database file index. php display message main program addnote. php add message delnote. php delete message
Mysql.txt
Create table notebook (name char (6), email varchar (35), time char (30), face char (2), ip varchar (16), title varchar (255 ), nnote text );
// Message book name email time face avatar ip title nnote content
Config. php
// Change the username and password of your database here
$ Db = mysql_connect ("localhost", "root ");
Mysql_select_db ("test", $ db );
// Change the user name and password
$ Username = "demo ";
$ Password = "demo ";
?>
Index. php



Message book



Include ("config. php ");
$ Result = mysql_query ("SELECT * FROM notebook", $ db );
$ Row = mysql_num_rows ($ result); // You can check the number of rows in the query result.
$ Max = $ row; // total number of posts
// Set 10 entries per page. you can set the total number of pages on $ p, the number of pages on $ page, and the number of rows on $ low.
If (! $ Page) {$ page = 1;} // The default value of $ page is 1.
$ P = ceil ($ max/10); // The maximum number of pages is the maximum integer of $ 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); // query BY post time in descending ORDER
?>





















Homepage
> Message book

Echo "total number of posts:", $ max, "no ";
For ($ n = 1; $ n <= $ p; $ n ++ ){
Echo "$ n ";
}
Echo "page ";
?>
Message Management

For ($ I = 0; $ I <= ($ X-1); $ I ++ ){
$ Name = mysql_result ($ result, $ I, 'name ');
$ Email = mysql_result ($ result, $ I, 'Email ');
$ Face = mysql_result ($ result, $ I, 'face ');
$ Face = 'image/face/icon '. $ face; // user Avatar
$ 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" ";Echo" ";Echo" ";Echo" ";Echo" ";Echo"
Contact: $ namePosted at: $ time$ Ip
Title: $ title
Message content: $ nnote
";
}
Mysql_close ($ db );
?>


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.