POST
is something included in an HTTP request (such as an XMLHTTPRequest
).
In your case, you are adding the query string to the URL, which means that it is being passed as a GET variable. Even if it is a post request, PHP can still access any GET variables added on as a query string.
Based on your code, I don't think you are telling the request what info should be included in the POST section of the request, which would explain why you are not seeing anything with $_POST['var']
.
But since $_REQUEST['var']
looks for request variables in GET
and POST
and any cookies passed in the request, you see the variable as it was passed via the query string.
Try echoing $_GET['var']
and you'll see that this is where the variable is getting the data from.
If you want to use POST the right way, you need to not point the request to a URL that has a query string and instead define that query string as the post data.