Teach you how to create a keyword matching project (search engine) ---- the first day, teach you to do ----
Day 1
The requirements are as follows:
1. Collect keywords and construct a keyword dictionary.
When I received this task, I thought it was not easy? Create a keyword entry interface and save it to the database. The first step was completed, and I laughed for a day. I didn't expect it to be so simple.
Database Configuration File: config. php
$database_host = 192.168.1.1$database_user = xiaoshuaishuai$database_password = xiaoshuaishuai$database_charset = "utf-8"
Background logic processing: keywords. php
<?phpinclude "config.php"$keywords = $_REQUEST["keywords"];$con = mysql_connect($database_host,$database_user,$database_password);mysql_query("SET NAMES '$database_charset'",$conn);mysql_select_db("dict",$conn);foreach($keywords as $keyword){ //save $keyword to database $sql = "insert into keywords(word) values ('$keyword')"; mysql_query($sql,$conn); }mysql_close($conn);
In Baidu search engines, search words match promotion keywords, for example?
Currently, Baidu has three matching methods: precision, phrase, and broad. Generally, the golden match method is: wide match + search term report + negative keyword. In terms of traffic, it is widely used> phrase> accurate. You can set it based on your actual situation!
How can I enter three keywords for exact match when I use a search engine?
If exact match is required, ABC must be enclosed by quotation marks.