Home >Backend Development >PHP Tutorial >PHP+ajax implements Google search function 2 [original]_PHP tutorial

PHP+ajax implements Google search function 2 [original]_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:59:23994browse

//

Original work

Original on this site: www.111cn.cn

Author: Noodles Love Rabbit QQ:271728967

Note: Please indicate the source of the reprint http://www.111cn.cn

//
Now let’s talk about the post.php file. The post.php file is very simple. This may not necessarily be done with PHP. It can be done with server scripts. {Personal opinion}

header("Content-type:text/html;charset=gb2312"); I will only talk about this sentence, setting 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"

";
while ($rs =mysql_fetch_array($result) ){
echo "
  • ". $rs['title']."
  • ";
    }
    echo"
    ";

    php+ajax implements Google search function 2 [Original].

    Browse address: http://www.111cn.cn/test/test.html

    www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631913.htmlTechArticle// Original work Original on this site: www.111cn.cn Author: Noodle Love Rabbit QQ: 271728967 Note: Please indicate the source of the reprint: http://www.111cn.cn // Now let’s talk about the post.php file, the post.php file...
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn