file_get_contents cURL replacement

Some hosting providers disable file() and file_get_contents() by default. However, cURL should still be available. If that is the case you can use this function as a replacement for file_get_contents().

 

cURL: Use Form on Another Site

I recently had to set up a package tracking form and page for a client. The problem was the company they ship through had it’s own package tracking system and we could not get an API or Database access so I had to setup cURL in order to send post requests to the 3rd party page and then parse the response to display the results the other form returned.

This method won’t work for many sites but since both the form and the response for this form were displayed on the same page it turned out being pretty simple.