REQUEST_METHOD: GET


By using the GET method, the input values from the form are sent as part of the URL, and saved in the QUERY_STRING environment variable. For an example of the GET method, consider the following form:
         

   Email:      Password: 
In Perl, the $query->url_param variable collects input values in the query string such as

   print $query->url_param('act');         // “Submit”
   print $query->url_param('email');     // “userid@cs.und.edu”
   print $query->url_param('password');       // “CSci513”

The GET method is not a secure method of sending data since the data is passed through as part of the URL, which will show up in the web server’s logfile. The advantage of the GET method is the page can be retrieved again by entering the URL. For example, after submit the keywords: PHP and MySQL to the Yahoo, the URL is changed to the following string:
   http://search.yahoo.com/search?p=PHP+MySQL&ei=UTF-8
and the variable values are $query->url_param('p') = “PHP MySQL” and $query->url_param('ei') = “UTF-8” if the Yahoo Search uses Perl. Spaces and some special characters are not allowed in URLs. The code ‘+’ is for the space ‘ ’ and the hexadecimal ASCII code ‘%40’ is for the symbol ‘@’ in URLs.




      Practice makes perfect.