Answer the question
In order to leave comments, you need to log in
What is $_REQUEST for?
Hello. I was looking into PHP and saw the following statements:
The $_REQUEST array is the union of the $_GET, $_POST, and $_COOKIE arrays.
If you don't know which method the value was passed in, use $_REQUEST [username]
Answer the question
In order to leave comments, you need to log in
For starters, what is POST for.
Let's imagine that you have a site example.com and on it a form with a button that deletes an article.
On the server, of course, you check whether the user is authorized and whether he has the right to delete.
When the button is clicked via post, the following parameters are passed
article_id: 123
action: delete
If you receive this data on the server using $_REQUEST, then a situation is possible when an attacker does this:
<img src="http://example.com?action=delete&article_id=1">
<img src="http://example.com?action=delete&article_id=2">
<img src="http://example.com?action=delete&article_id=3">
<img src="http://example.com?action=delete&article_id=4">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question