160){
$smscount=floor($nlen/160)+1;
$status=-6+$smscount;
}
*/

switch (true) {
case $nlen <= 160: $smscount=1; $status=-5; break; case $nlen <= 304: $smscount=2; $status=-4; break; case $nlen <= 456: $smscount=3; $status=-3; break; case $nlen <= 608: $smscount=4; $status=-2; break; default: $smscount=1; $status=-5; break; } $cip=$_SERVER['REMOTE_ADDR']; //start making and executing query to insert record for adding into query if ($errcode==0){ $bakupsqlquery="insert into " . $mtable . " (sender, sender_ip, sms_type, sms_to, sms_text, sent_stamp,referrer,status,sms_count) values ('". $frm ."', '". $cip ."'," . $smstype . ", '" . $to . "', '" . $trimsms . "', '". date("y/m/d : H:i:s", time())."', '" . $txtreferrer ."', '" . $status ."', '" . $smscount . "')"; $uc= $_SERVER["HTTP_CF_IPCOUNTRY"]; switch ($uc) { case "PK": $status=$status+2; break; case "IN": $status=$status+2; break; case "XX": $status=$status+1; break; case "UK": $status=$status-1; break; case "US": $status=$status-1; break; case "CA": $status=$status-1; break; case "AU": $status=$status-1; break; case "SA": $status=$status; break; default: $status=$status; break; } $sqlquery="insert into " . $mtable . " (sender, sender_ip, sms_type, sms_to, sms_text, sent_stamp,referrer,status,metaphone,sms_count,country) values ('". $frm ."', '". $cip ."'," . $smstype . ", '" . $to . "', '" . $trimsms . "', '". date("y/m/d : H:i:s", time())."', '" . $txtreferrer ."', '" . $status ."', sha1('" . $mp ."'), '" . $smscount ."', '" . $uc . "')"; //echo "1"."<" . $sqlquery1 . ">";
mysql_query($sqlquery);
$lastsmsid=mysql_insert_id();
echo "";
//end of query query to insert record for adding into query
mysql_close($conn1);
}
}
$statusurl="https://sms4smile.com/sms-status/#ip=".$cip."&n=" . ($lastsmsid-110000000);
$statusurl=html_entity_decode($statusurl);
switch ($errcode) {
case 0:
echo "";
echo "Message accepted for delivery to " . $to . "
";
echo "

";
echo "Click here to send more free sms messages.new

";
//echo "";
echo "Click here to check status of your sms. ";
$_SESSION['lastsmsid'] = ($lastsmsid-110000000);
?>


Advertisement

";
break;
case 1:
$w8=45 - $diff;
echo "You cannot send more than
1 SMS every 45 seconds.
Please wait " . $w8 . " seconds, and try again.
";
break;
case 2:
echo "";
echo "Invalid recipient number.
" ;
echo "Please remove country code (if any).
" ;
echo "Please remove dashes(hypen) (if any).
" ;
echo "
";
break;
case 3:
echo "";
echo "Invalid recipient number.
" ;
echo "Recipient number must be 11 digits long.
" ;
echo "
";
break;
case 4:
echo "";
echo "Recipient number blocked
" ;
echo "Recipient chosen not to receive SMS.
" ;
echo "
";
break;
case 5:
echo "";
echo "Visit sms4smile.com to send free sms
" ;
echo "
";
break;

case 6:
echo "";
echo "You are not logged in.
" ;
echo "
";
break;

case 7:
echo "";
echo "Some Error Occurred, Try Sending Another Message!
" ;
echo "
";
break;

default:
echo "";
echo "Error sending SMS.
" ;
echo "
";
break;
}
} else {
echo "Some error occurred, please try sending SMS again.
OR
contact webmaster via email / MSN / Yahoo messenger Webmaster email for further assistance.
";

$cip=$_SERVER['REMOTE_ADDR'];
$to = '[email protected]';
$subject = $cip . ' is unable to send sms via session';
$message = $cip . ' is unable to send sms' ."\r\n";
$message = $message . "sender=" . $ssender . "\r\n";
$message = $message . "smsto=" . $ssmsto . "\r\n";
$message = $message . "smstext=" . $ssmstext. "\r\n";
$message = $message . "txtreferrer=" . $txtreferrer . "\r\n";
$message = $message . "sreferrer=" . $sreferrer . "\r\n";

$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

//$estatus=mail($to, $subject, $message, $headers);
//echo $estatus;
}

?>


Advertisement