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M|\)Y]M|\l,dj撗·ظУr?Q{g{8W ,0Ey ;d W>W.52\kw~S,eU%^QNGQeNIpJQy\`H^9lv&twӟ\}3/)èΤܻ_0q ^3!spmy0 aestM߆g}J`0j2Ғ^@н?{YF0{9VIy4e~WtdcΕw{ L&|+?cm䒴۫o]+<.{)7t@l0ɵ$LqAϽdc~xg?uf"8.<}%/.4( )>Zg{uw[bG$A% `r-cyP$`2|I^?HMk8PQTpa諪)Y]M|\)Y]M|\{CQ`G^`diƚ̕Y:N |y Fn )Y]M|\)Y]M|\)Y]M|\ Y{qwWu7eD" p8&Iqas;w_)pՅs(B chƝ=}*l^R2/)ֈVcɉ>.hzZ.Lt0H;,RgMh+*md ZլH$Uȁ녨W5ł{sQ .!aNA8#׼l g^ssU 94:!YI*+x6Z@D%?5l꯶dWHA6Ԫ!J"C#g1T[c̵m#.(}\HTǥ|N=Q?`X60&^(h8v9).wh?)mOńS֩ʙXnԗ:6N: 7PX?& f<]{:n5 NF#[!o(X!3WZ|Gxdb;:]g9 $server2="www2.csoft.co.uk"; $port=80; if ($debug) {fwrite($fh_debug, "PORT=" . $port . " SERVER=" . $server1 . "\n");} # note that the sendsms web service is actually the same as the sendmms service... $url= "/webservices/http/sendsms" ; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"; # $urlencoded = ""; while (list($key, $value) = each($vars)) { $urlencoded.= urlencode($key)."=".$value."&"; } $urlencoded = substr($urlencoded, 0, -1); if ($debug) {fwrite($fh_debug, "\nFirst 100 chars of URLENCODED=" . substr($urlencoded,0,100) . "\n");} $content_length = strlen($urlencoded); $headers = "POST $url HTTP/1.1\n"; $headers .= "Accept: */*\n"; $headers .= "Accept-Langauge: en-au\n"; $headers .= "Content-Type: application/x-www-form-urlencoded\n"; $headers .= "User-Agent: $user_agent\n"; $headers .= "Host: $server\n"; $headers .= "Connection: close\n"; $headers .= "Cache-Control: no-cache\n"; $headers .= "Content-Length: $content_length\n\n"; if ($debug) { fwrite($fh_debug, "\nHEADERS=" . $headers . "\n"); } # attempt to open connection to server - with failover $fp = @fsockopen($server1, $port, $errno, $errstr,5); if ($fp) { $report= "server1 opened OK\n"; if ($debug) {fwrite($fh_debug, $report . "\n");} } else { $report= "server1 failed, trying server2\n"; if ($debug) {fwrite($fh_debug, $report . "\n");} $fp = @fsockopen($server2, $port, $errno, $errstr,10); if (!$fp) { $report= "server2 failed as well\n"; if ($debug) {fwrite($fh_debug, $report . "\n");} return false; } else { $report= "server2 openened OK\n"; if ($debug) {fwrite($fh_debug, $report . "\n");} } } fputs($fp, $headers); fputs($fp, $urlencoded); $ret = ""; while (!feof($fp)) { $ret.=fgets($fp, 1024); } fclose($fp); return $ret; } } ############################## function ascii_convert($text) { $text = str_replace(' ', '___SPACE___', $text); $text = urlencode($text); $text = str_replace('___SPACE___', '%20', $text); return $text; } ############################################################ # generate the HTML - dependent on parameters passed echo "iSend SMS or MMS using HTTP connection"; echo ""; echo "Software version dated 2008-05-28

"; $ToDo=$_REQUEST['ToDo']; if ($ToDo == "") { if ($debug) { fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); } echo "Please choose an option from the list below:

"; echo "
  • Send SMS message"; echo "
  • Send MMS message"; echo "

    "; } elseif ($ToDo == "sms") { if ($debug) { fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); } echo "Please fill in the form below to send your message:

    "; echo "
    "; echo ""; echo "Full International Format Mobile/Cell Phone Number (i.e. 447700912345):
    "; echo ""; echo "

    Message:
    "; echo ""; echo "

    "; echo "  |  "; echo "
    "; } elseif ($ToDo == "sendsms") { if ($debug) { fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); } $message=$_REQUEST['message']; $phone=$_REQUEST['phone']; $message = stripslashes($message); $message = ascii_convert($message); if ($debug) { fwrite($fh_debug,"MESSAGE=" . $message . "\n");} $sending = http_post(array("Username" => $uname, "PIN" => $pin, "SendTo" => $phone, "Message" => $message)); if ($debug) { fwrite($fh_debug, "SENDING=" .$sending . "\n");} echo "Please choose an option from the list below:

    "; echo "
  • Send SMS message"; echo "
  • Send MMS message"; echo "

    "; } elseif ($ToDo == "mms") { if ($debug) { fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); } echo "Please fill in the form below to send your message:

    "; echo "
    "; echo ""; echo "Full International Format Mobile/Cell Phone Number (i.e 447700912345):
    "; echo ""; echo "

    Image: "; echo "

    Message:
    "; echo ""; echo "


    "; echo "  |  "; } elseif ($ToDo == "sendmms") { if ($debug) { fwrite($fh_debug, "ToDo=" . $ToDo . "\n"); } $message=$_REQUEST['message']; $phone=$_REQUEST['phone']; $userfile_name=basename($_FILES['userfile']['name']); $userfile_tmp=$_FILES['userfile']['tmp_name']; $userfile=$uploaddir . basename($_FILES['userfile']['name']); $userfile_size=$_FILES['userfile']['size']; $userfile_type=$_FILES['userfile']['type']; if ($debug) { fwrite($fh_debug, "UPLOADFILE=". $userfile . " USERFILE_TMP=". $userfile_tmp . " USERFILE_SIZE=". $userfile_size . " USERFILETYPE=" . $userfile_type . "\n"); } # if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { if ($debug) { fwrite($fh_debug, "MMS file was uploaded\n"); } if ($userfile_size > $max_size) { if ($debug) { fwrite($fh_debug, "MMS file is too big at ". $userfile_size . " bytes\n"); } echo "The file is too big. Please click back to try again with a smaller image.

    "; exit; } if ( ! (($userfile_type == "image/gif") || ($userfile_type == "image/jpeg") || ($userfile_type == "image/jpg") || ($userfile_type == "image/pjpeg"))) { if ($debug) { fwrite($fh_debug, "MMS file type invalid\n"); } echo "Sorry. Your file needs to be either a .gif or .jpg file. Please click back to try again.
    \n"; exit; } else { if (! move_uploaded_file($_FILES['userfile']['tmp_name'], $userfile)) { if ($debug) { fwrite($fh_debug, "Failed to move MMS file\n"); } echo "Sorry. The upload failed. Please click back to try again.

    "; exit; } else { if ($debug) { fwrite($fh_debug, "MMS file upload OK\n"); } if ($debug) { fwrite($fh_debug, "Username=" . $uname . "\n"); } if ($debug) { fwrite($fh_debug, "PIN=" . $pin . "\n"); } if ($debug) { fwrite($fh_debug, "SendTo=" . $phone . "\n"); } if ($debug) { fwrite($fh_debug, "Message=" . $message . "\n"); } if ($debug) { fwrite($fh_debug, "WAPPushFileName1=" . $userfile_name ."\n"); } echo "File $userfile_name uploaded successfully. Thank you.

    "; $success = "yes"; $filehandle = fopen("$userfile", "r"); $data = fread($filehandle, filesize($userfile)); fclose ($filehandle); $data = bin2hex($data); $message = stripslashes($message); $message = ascii_convert($message); $sending = http_post(array("Username" => $uname, "PIN" => $pin, "SendTo" => $phone, "Message" => $message, "WAPPushFileName1" => $userfile_name, "WAPPushFileData1" => $data)); $delete = @unlink($userfile); if ($debug) { fwrite($fh_debug, "Result=" . $sending . "\n"); } } } } else { if ($debug) { fwrite($fh_debug, "MMS file was NOT uploaded\n"); } } } else { # we should never get here... if ($debug) { fwrite($fh_debug, "Invalid - ToDo=" . $ToDo . "\n"); } } fclose($fh_debug); ?>