Php ajax paging-PHP source code

Source: Internet
Author: User
Php ajax paging 1. [File]SQL. SQL
CREATE TABLE `tb_user` (  `id` int(10) NOT NULL auto_increment,  `username` varchar(50) NOT NULL,  PRIMARY KEY  (`id`)) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;INSERT INTO `tb_user` VALUES (1, 'aaa');INSERT INTO `tb_user` VALUES (2, 'bbb');INSERT INTO `tb_user` VALUES (3, 'ccc');INSERT INTO `tb_user` VALUES (4, 'ddd');INSERT INTO `tb_user` VALUES (5, 'eee');INSERT INTO `tb_user` VALUES (6, 'fff');INSERT INTO `tb_user` VALUES (7, 'ggg');INSERT INTO `tb_user` VALUES (8, 'hhh');INSERT INTO `tb_user` VALUES (9, 'жпнд');

2. [File]Ajaxpage. js
Var http_request = false; function send_request (url) {// initialization, specifies the processing function, and the request sending function http_request = false; // starts to initialize the XMLHttpRequest object if (window. XMLHttpRequest) {// Mozilla http_request = new XMLHttpRequest (); if (http_request.overrideMimeType) {// Set the MIME category http_request.overrideMimeType ("text/xml");} else if (window. activeXObject) {// IE browser try {http_request = new ActiveXObject ("Msxml2.XMLHttp");} catch (e) {try {http_reque St = new ActiveXobject ("Microsoft. XMLHttp");} catch (e) {}} if (! Http_request) {// exception. failed to create the object instance window. alert ("failed to create the XMLHttp object! "); Return false;} http_request.onreadystatechange = processrequest; // Determine the request sending method, URL, and whether to synchronously execute the following code http_request.open (" GET ", url, true ); http_request.send (null);} // function processrequest () {if (http_request.readyState = 4) {// judge the object status if (http_request.status = 200) {// The information has been returned successfully. start to process the information document. getElementById (reobj ). innerHTML = http_request.responseText;} else {// The page is not normal alert ("the page you requested is not normal! ") ;}} Function dopage (obj, url) {document. getElementById (obj ). innerHTML = "reading data... "; reobj = obj; send_request (url );}

3. [Code][PHP] code
PHP + ajax paging demonstration
 

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.