Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I tell for a php page if someone came by POST or GET?

Tags:

People also ask

How do you check if a request if coming from the same server or different server?

Basically : you cannot. With the HTTP protocol, each request is independent from the others. A first idea would be to check the Referer HTTP header, but note that : It can be faked (it's sent by the browser)

Can I use get and post at the same time in PHP?

Show activity on this post. and then PHP will populate $_GET['foo'] as well, although the sent Request was POST'ed. However, your problem seems to be much more that you are trying to send two forms at once, directed at two different scripts. That is impossible within one Request.


I'd like to have a page in php that normally displays information based on the GET request sent to it. However, I'd like for it to also be able to process certain POST requests. So, how can I tell if any data was sent by POST so I can act on it?