Reading Request Data

suggest change

Remarks

Choosing between GET and POST

GET requests, are best for providing data that’s needed to render the page and may be used multiple times (search queries, data filters…). They are a part of the URL, meaning that they can be bookmarked and are often reused.

POST requests are meant for submitting data to the server (contact forms, login forms). A GET request has no body, so it is a poor place for a file. POST can carry binary data, including file uploads. Query strings are percent-encoded bytes, not an ASCII-only channel.

You can find a more detailed explanation of their differences here.

Request Data Vulnerabilities

Also look at: http://stackoverflow.com/questions/1301863/what-are-the-vulnerabilities-in-direct-use-of-get-and-post

Retrieving data from the $_GET and $_POST superglobals without validation is a bad practice. It can open the door to code injection and SQL injection. Invalid data should be rejected.

Request data should be escaped depending on how it is being used in code, as noted here and here. A few different escape functions for common data use cases can be found in this answer.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents