$value) { $fields_string .= $key.'='.$value.'&'; } rtrim($fields_string, '&'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL , $url); if ($fields){ curl_setopt($ch, CURLOPT_POST , count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS , $fields_string); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , FALSE); curl_setopt($ch, CURLOPT_COOKIEFILE , "cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEJAR , "cookie.txt"); curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION , true); curl_setopt($ch, CURLOPT_COOKIE , $cookie); $result = curl_exec($ch); $datas = curl_getinfo($ch); curl_close($ch); return $result; } $cookie = ""; /* Debug : ./script.php | grep c2cprenom $fields=array(); $url = "http://www.bouyguestelecom.fr/mon-compte/"; echo curl_it($url, $fields, $cookie); exit(); */ $fields = array( 'fieldMsisdn' => '06xxxxxxxx', 'fieldMessage' => 'Your message', 'Verif.x' => '34', 'Verif.y' => '7', ); $url = "http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/confirmSendSMS.phtml"; echo curl_it($url, $fields, $cookie); $url = "http://www.mobile.service.bbox.bouyguestelecom.fr/services/SMSIHD/resultSendSMS.phtml"; echo curl_it($url, $fields, $cookie);