Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

Addresses with ? and &

I see addresses such as:
http://www.abc.com/db.pl?db=default&uid=default
They are calling a perl script, but what do the ?  and  &  signify?  How does the perl script know what to do with them?
0
Lee5
Asked:
Lee5
1 Solution
 
rajgnCommented:
The string(in this case, 'db=default&uid=default') after ? in a URL is called QUERYSTRING. This is one of the methods(called GET method, other is POST) of passing informatiion from your browser to the server. In a CGI script you can collect this string in a variable named QUERY_STRING(or may be QUERYSTRING). An & in this string seperates various key-value pairs(in this case there are two key-value pairs). Once you read this in your CGI you can parse the string and respond accordingly. Generally this method is used when you've to send small amount of information. If the data to send is more POST method is used.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now