I have the following script. In the remote php script a record is added to a database table.
When I leave the last line (print $html;) in this script, 2 records are added!
Set CURLOPT_RETURNTRANSFER to false and just do curl_exec($ch) instead of $html = curl_exec($ch). Then the curl output will be directly returned to the browser.