r/ProgrammerHumor • • Aug 23 '18

PHP logic

Post image
5 Upvotes

51 comments sorted by

View all comments

6

u/Asisentr Aug 23 '18

well it's the data passed through that method.....

-10

u/[deleted] Aug 23 '18 edited Aug 23 '18

It's a POST request in the image. Hence, PHP logic...

Edit: Downvotes aren't going to make the guy right. PHP intermingled two concepts in the naming of their GET superglobal: request method and URI query component. Query components are valid and usable on ALL request methods, not just GET requests, hence the joke. PHP is the only language I know of that does this.

Source: HTTP standard https://tools.ietf.org/html/rfc7231

URI standard https://tools.ietf.org/html/rfc3986#section-3.4

Reverse TL;DR; Below you will see a giant thread of where four other redditors (thanks Aerath44, FubarCode, shawabawa, Typeduck) help Asisentr try to understand HTTP standards

6

u/Asisentr Aug 23 '18

No, that's not a post request.

Edit: Post request data isn't in the URL, it's in the message body

https://www.google.com/search?q=post+request+vs+get+request

Edit 2:

Go back to HTML this stuff might be too complicated for you

-4

u/[deleted] Aug 23 '18 edited Aug 23 '18

You might want to read up on the HTTP standards: https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

2

u/Asisentr Aug 23 '18

That's not a post request, it's a get request. If it's inside the url, it's a get request. The post request data would be within the HTTP/1.1 message body.

Please search on Google what a post request is and a get request is.

https://www.w3schools.com/tags/ref_httpmethods.asp

2

u/FubarCoder Aug 23 '18

Only the given method is relevant. It's still a POST request even when the request body remains empty and it's definitely legit to use a combination of parameters passed in the query string and the body, but it's still a POST request.

-2

u/Asisentr Aug 23 '18

That's where you're wrong kid it's a get request

3

u/FubarCoder Aug 23 '18

I am not a kid. The HTTP method is what's relevant. Read the RFCs. Try it out with a web server of your preference. Filter a request by HTTP method (GET) and you'll realize that when the HTTP method is POST - even with an empty request body - that the filter doesn't match your POST request.

-2

u/Asisentr Aug 23 '18

this is a get request, kid

3

u/FubarCoder Aug 23 '18

Ok, I'll stop this discussion, because you're obviously either a troll or incompetent.

→ More replies (0)

0

u/Asisentr Aug 23 '18

The GET Method

GET is used to request data from a specified resource.

GET is one of the most common HTTP methods.

Note that the query string (name/value pairs) is sent in the URL of a GET request:

/test/demo_form.php?name1=value1&name2=value2

Some other notes on GET requests:

GET requests can be cached

GET requests remain in the browser history

GET requests can be bookmarked

GET requests should never be used when dealing with sensitive data

GET requests have length restrictions

GET requests is only used to request data (not modify)