Fetion Interface Instance application code
Fetion Interface Instance application code
Header ("content-type:text/html; Charset=utf-8 ");
error_reporting (0);
Include ". /libs/fetion.class.php Tutorial ";
$demo = $_get[demo];
$help = ' Help: If you need to group multiple numbers with commas (,) delimited (159..,159.), please contact qq:85431993 for more advice.
E-mail:threesky@gmail.com ';
$api = "This site interface:
Http://api.heqee.com/fetion/?username= fetion Mobile phone number &passowrd= fetion phone password &to= receiver number &message= SMS content
Or
http://api.heqee.com/fetion/?u= fetion Mobile phone number &p= fetion mobile phone password &t= receiver number &m= SMS content ";
if ($demo! = "") {
if (!in_array ($demo, Array ("Send", "code", "Help", "API")) {error ("parameter wrong!");}
Switch ($demo) {
Case ' code ':
Exit (Highlight_file ("demo.php", true);
break;
Case "help":
Exit ($ Help);
break;
Case ' API ':
exit ($API);
break;
}
}
Function Getval ($key) {
if (!isset ($_post[$key)) | | $_post[$key]==null| | $_post[$key]== ") {
return ($_get[$key]! =" && isset ($_get[$key))? Trim ($_get[$key]): null;
} else{
Return ($_post[$key]! = "&& isset ($_post[$key]))? Trim ($_post[$key]): null;
}
}
Function error ($MSG) {
Exit ("heqee info: ". $msg);
}
function Gbktoutf8 ($value) {
Return Iconv ("GBK", "Utf-8", $value);
}
$send =array ();
$send [' username '] = getval (' username ')! = null? Getval (' username '): Getval (' U ');
$send [' password '] = getval (' password ')! = null? Getval (' password '): Getval (' P ');
$send [' to '] = getval (' to ')! = null? Getval (' to '): Getval (' t ');
$send [' message '] = Gbktoutf8 (getval (' message ')! = null? getval (' message '): Getval (' m '));
$send [' Message_len ']=strlen ($send [' message ']);
Switch ($send) {
Case $send [' username ']==null:
Error (' Please enter the number of the login phone. ');
Break
Case $send [' Password ']==null:
Error (' Please enter the password for the login phone. ');
Break
Case $send [' to ']==null:
Error (' Please enter the number of the receiving phone. ');
Break
Case $send [' Message ']==null:
Error (' Please enter SMS content. ');
Break
Case $send [' Message_len '] >360:
Error (' message content cannot exceed 180 characters. ');
Break
}
$fetion = new Fetion ($send [' username '], $send [' Password ']);
$fetion->send ($send [' to '], $send [' message '];
?>
Instance Application
/*
PHP Extensions required: curl, SimpleXML
*/
Include "libs/fetion.class.php";
#设置飞信帐号密码
$username = "15900000000";
$password = "password";
Receive number, multiple numbers with "," Delimited (159..,159.)
$sendto = "15900000000,13400000000";
Message content
$message = "I am from heqee.com";
Instantiation (required)
$fetion = new Fetion ($username, $password);
Send return Boolean
$sms = $fetion->send ($sendto, $message);
if ($sms) {
echo "OK";
}
http://www.bkjia.com/PHPjc/444879.html www.bkjia.com true http://www.bkjia.com/PHPjc/444879.html techarticle Fetion Interface Instance application code fetion interface Instance application code header (content-type:text/html; charset=utf-8); error_reporting (0); include: /libs/fetion.class.php tutorial; $demo = $_g ...