#!/usr/bin/php -q $val){ //we have to urlencode the values $request.= $key."=".urlencode($val); //append the ampersand (&) sign after each paramter/value pair $request.= "&"; } //remove the final ampersand sign from the request $request = substr($request, 0, strlen($request)-1); $host = "www.lowratevoip.com"; $script = "/myaccount/sendsms.php"; $request_length = strlen($request); $method = "GET"; // must be POST if sending multiple messages if ($method == "GET") { $script .= "?$request"; } //Now comes the header which we are going to post. $header = "$method $script HTTP/1.1\r\n"; $header .= "Host: $host\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: $request_length\r\n"; $header .= "Connection: close\r\n\r\n"; $header .= "$request\r\n"; //Now we open up the connection $socket = fsockopen("ssl://".$host, 443, $errno, $errstr, 60); if ($socket) //if its open, then... { fputs($socket, $header); // send the details over while(!feof($socket)) { $output[] = fgets($socket); //get the results } fclose($socket); } /* the message id's will be kept in one of the $output values print ""; print_r($output); print ""; */ ?>