Buon... a tutti e grazie anticipatamente; ho adattato lo script fopen in modo che usi la libreria curl ma continua a non funzionare; suggerimenti ???
// script fopen *******************************************
$url = "http://www.sito.it/gateway/send.asp?"
. "username=$user"
. "&password=" . UrlEncode($pw)
. "&destinatari=" . UrlEncode($destinatari)
. "&mittente=" . UrlEncode($mittente)
. "&dati=" . UrlEncode($dati)
. "&tipo=" . UrlEncode($tipo);
/* chiamata http/GET*/
if (($f = @fopen($url, "r"))){
$answer = fgets($f, 255);
//$answer="Errore";
if (substr($answer, 0, 2) == "OK"){
fclose($f);
return 1;
}
fclose($f);
return 0;
} else return 0;
// script curl **********************************************
$str = "username=$user"
. "&password=" . UrlEncode($pw)
. "&destinatari=" . UrlEncode($destinatari)
. "&mittente=" . UrlEncode($mittente)
. "&dati=" . UrlEncode($dati)
. "&tipo=" . UrlEncode($tipo);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.sito.it/gateway/send.asp?");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$answer = curl_exec ($ch);
curl_close($ch);
if(substr($answer, 0, 2) == "OK") return 1;
else return 0;