Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

For Experts: Exactly How Is That URL Formatted?

experts URL
0
10 Posted

For Experts: Exactly How Is That URL Formatted?

0
10

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.