What is URL ?

Understanding more complex URLs and parameters

A URL performs additional functions and added the parameters (additional information) to the end of the URL when it points to a script. For example, when you search any query on any search engine, it points to a search results page, including the additional information with the search query words.

An URL example is given below that points to the javatpoint search page, including the search query parameter of example search.  

In cgi-bin directory, the script file being pointed to is search.cgi in the above URL example. It is assumed to be a Perl script as this file ends with .cgi.

The file name is a question mark (?) after the script. In the URL, the question mark separates the URL from all the variables or parameters to be sent to the script. The parameter being sent is q=example%20search, in the above URL example. The “example%20search” is the value that is sent to the “q” variable. Space is encoded as %20 as spaces are allowed in a URL. Furthermore, a+ is also used to represent space in many scripts.

There is a variable in the example that is executed, as the script uses it. Also, scripts can contain multiple variables; each variable is separated by a symbol & (ampersand), as shown in the following example: 


The above example contains two different variables; the q” variable equals “example search” and the “example” variable equals “test.”

Leave a Reply

Your email address will not be published. Required fields are marked *