Sto provando a richiamare gojack in questo modo:
$message="ciaociao";
$address="http://miosito/gojack.php";
$addarray=parse_url($address);
$fp = hostconnect($addarray['host'], 30, "Errore, sito non disponibile");
$poststring="";
$poststring .= "servizio=Vodafone-Widget&";
$poststring .= "user=".$username."&";
$poststring .= "pass=".$password."&";
$poststring .= "rcpt=".$intnum."&";
$poststring .= "text=".urlencode($message);
fputs($fp, "POST ".$addarray['path']."?".$addarray['query']." HTTP/1.1\r\n");
fputs($fp, "Host: ".$addarray['host']."\r\n");
fputs($fp, "User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0\r\n");
fputs($fp, "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n");
fputs($fp, "Accept-Language:it-it,it;q=0.8,en-us;q=0.5,en;q=0.3\r\n");
//fputs($fp, "Accept-Encoding:gzip, deflate\r\n");
fputs($fp, "Connection:keep-alive\r\n");
fputs($fp, "Content-Length: ".strlen($poststring)."\r\n\r\n");
fputs($fp, $poststring. "\r\n\r\n");
E la risposta è:
HTTP/1.1 200 OK Date: Sun, 03 Jun 2012 12:39:43 GMT Server: Apache/2.2 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: PHPSESSID=abb89ac5dd8ad2ba337c490077c7a449; expires=Sun, 03-Jun-2012 15:39:43 GMT; path=/ Content-Length: 70 Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Content-Type: text/html 1Mancano dati fondamentali: messaggio
Come mai? Sei sicuro che io possa passare le variabili sia in post che in get???