GET and POST are http operations.

Sending values by using the ? as a separator in the url is different but related. eg:

foo.com/page.php?val1=1&val2=2

The values are called Query String values.

For GET operations, values are sent as a query string values. For POST operations, the values are sent in the body of the POST request. This is why POST must be used when a lot of data is being sent to the server. (Query strings have a maximum length, HTTP requests do not.)

You can do a POST operation to a url that includes query string values. This is more common with Ajax requests but can be done in a form as well. Just set the action url to something like index.php?val1=1&val2=2 the form's (additional) values will be sent as the http body. Remember to set method="post" in the form.

Note that you will need to create the query string yourself in this example, including escaping it properly.

Repeating value names in the query string values

Usually this causes both values to be sent, but the server overwrites the variable and ends up only presenting the last one to the client software.

So if you use a url such as

<a href="http://localhost/index.php?get=abc&post=cde&post=efg">

// It will be decoded by php and most server-side frameworks as

set get to abc

set post to cde

set post to efg

Result: 2 variables, get and post