7. Building an automatic news publishing system for your website)
Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
In the previous section, our news system has been able to add and delete news online, but this is not enough, some users may need to find related news entries in a previous topic. However, a News system that is better than others can't help but complete this function.
Now let's add the retrieval function (full text/title) to our news system. First, let's make a retrieval form. See the following HTML code, place the code on the web page that requires news retrieval. You can easily complete news search.
Form method = "POST" action = "http://XXX..com.cn/cgi-win/search/search.asp"
P select name = "select" size = "1"
Option selected value = "search_1" news search (title)/option
Option value = "search_2" news search (full text)/option
/Select, input type = "text" name = "key" size = "20", input type = "submit" value = "search"
Name = "search"/p
Add the search ASP program search. asp on the basis of this FORM. In the form, we use the key parameter to indicate the string to be matched, while the select parameter specifies whether to search based on the full text or the title.
Now go to the program processing section and check out our search. asp program.
* Search. asp
'% @ Language = "vbscript" %'
If request. form ("key") = "" then
Response. redirect "/"
Select case request. form ("select ")
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.