function do_post($url, $data)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
$url is the website url for the request.
$data is an array that contains the form data that you want to send to the server. For example,
$data = array('name'=>'Bui Hoang Hai', 'website'=>'http://www.romajidesu.com')