For Experts: Exactly How Is That URL Formatted?
The format of a GET-method URL isn’t all that hard to understand. Input field names are separated from their values by the = character, and the name/value pairs are separated by the & character. That’s not quite the whole story. Certain special characters could cause confusion if they appeared in the form data itself. Specifically, =, &, “, % and any characters that are not legal in a URL are “escaped” as %xx where xx is the ASCII code of the character in hexadecimal. But you don’t need to worry about this, because the web browser automatically does it for you when the user clicks the “submit” button of the form. Then the web server recognizes that there is a ? mark in the URL, slices off that part, and gives it to PHP (or ASP, or ASP.NET, or Perl’s CGI.pm, or…) which automatically unpacks the data. And PHP programmers can then find it in the $_GET array.