//
Original Works
Original Site: www.111cn.cn
Author: Noodle love rabbit QQ: 271728967
Note: Reprint please explain the original out of http://www.111cn.cn
//
Now let's talk about the post. php file. The post. php file is very simple. It may not be used in php many times, as long as it can be completed at the server foot. {personal opinion}
Header ("Content-type: text/html; charset = gb2312"); set the document encoding.
$ Key = isset ($ _ POST ['key'])? $ _ POST ['key']: '';
$ SQL = "select title from test where title like '% $ key %' order by title desc ";
$ Result = mysql_query ($ SQL) or die (mysql_error ());
Echo "<div id = show> ";
While ($ rs = mysql_fetch_array ($ result )){
Echo "<li onMouseOver = \" this. style. background = '# d7ebff' \ "onMouseOut = \" this. style. background = '# ffff' \ "onclick = \" javascript: fillin (this. innerHTML); \ "> ". $ rs ['title']. "</li> ";
}
Echo "</div> ";
Php + ajax implement google search function 2 [original].
Http://www.111cn.cn/test/test.html address: