php/linux - performing an http post the easy way
It’s been a while since I added anything so here I go. If you have access to execute shell commands and curl is installed on your linux box then this is by far the easiest way to perform an HTTP POST. Here is the simple code:
exec("curl -d \"poststring=true&easy=yes\" http://www.somedomain.com");
Of course you can jazz this up by turning the post string into a variable a long with the url you are posting to. If you add a second parameter to the exec function such as $result then you can easily get a response from the host you are posting too. I came up with this simple method while working on a project at work. I was having problems getting PHPs built-in curl functionality to work, so this was the next best thing or better.
