These URLs use what is called a query string. This is a "GET" request, which allows the client script (javascript), as well as the reverse code to receive the user request. In the url when you see '?' this is the beginning of the query string. This allows someone to be as follows:
http://google.com?q=Stuff%20to%20Search%20here Several parameters can be added via & anothercommand = somethingelse
Thus, allowing a program or script to invoke a google search without having to type anything in a field.
You can access the query string using C # "Request.QueryString [" parameter "]", where in this case the parameter for this URL will be "q".
After that, you query your database and return the results. Since I'm not sure how good at coding, I'm not sure if you are trying to ask for a website or C # SQL side. If I'm wrong, apologize.
On the client: The way I assume this is happening on the client is that the script in the text field when sending the form is redirected to the URL you specified and adds the url string to these request parameters. Remember to encode url. This is built into javascript. those. space '' becomes "% 20"
When the form is submitted, the server code checks to see if there are any query string parameters in the q form. If they are and are not null, it will query the database, returning it in one of several ways, most likely through the server control.
1) This is what URL encoding is. This is a list of characters that are not supported in the URL. Therefore, they need to be changed. There is a standard set, such as% 20 for space. In javascript, you redirect to the results page with the desired query string. before redirecting, use here to encode it. those. change '' to + or% 20 (it really should be% 20, I find +, as a rule, in the way of an Internet explorer.)
2) The query string acts as a hash table of key pair values. Using Request.QueryString, you can select the key "q" and get the string "a few random words." Then it will be replaced with your SQL query. This is done on the C # side as the very first check to see if the q parameter exists.
3) you can make your request in many ways. However, the search for "and", etc. Will give you many different results. What you can do is parse the list of common words, and then rank the results based on the number of results for each word. those. in the most simplified search, which is not recommended for large databases "..... Where, for example,"% word% or "% word2%", etc. To get each word, execute string.split.