Nu virker det:
<?php
show_source(__file__) ;
$fp = fsockopen("sms.wannafind.dk", 80, $errno, $errstr, 30);
if (!$fp)
{
echo $errstr . " (" . $errno . ")<br />\n";
}
else
{
//Settings...
//See:
http://sms.wannafind.dk/api/docs/ //Specify the username to your SMS account
$username = "USER";
//Specify the password to your SMS account, encrypted as md5
//PlainText
$password = "PASS";
//A limit of 1 is recommended to avoid unforseen charges
$limit = 1;
//Specifies the recipient of the SMS
$to = "12345678";
//Specifies the message to be sent
$message = "SMS Test";
//Set the number that the receiver will see as the sender of the SMS
$from = "87654321";
//If set, the message will be delivered as a flash message
//Disable = false, Enable = true
$flash = false;
//Vi bygger den fulde streng som skal sendes...
$entire = "username=".$username."&password=".md5($password);
if(isset($limit))
{
$entire .= "&limit=".$limit;
}
$entire .= "&recipient=".$to."&message=".urlencode($message);
if(isset($from))
{
$entire .= "&from=".$from;
}
if($flash)
{
$entire .= "&flash=".$flash;
}
$out = "POST /api/index.php HTTP/1.1\r\n";
$out .= "Host: sms.wannafind.dk\r\n";
$out .= "Keep-Alive: 300\r\n";
$out .= "Connection: close\r\n";
$out .= "Content-Type: application/x-www-form-urlencoded\r\n";
$out .= "Content-Length: ".strlen($entire)."\r\n\r\n";
$out .= $entire . "\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp))
{
echo fgets($fp, 128);
}
fclose($fp);
}
?>