The application code of the Apsara stack interface instance. Apsara stack interface instance application code header (content-type: texthtml; charsetutf-8); error_reporting (0); include .. libsfetion. class. php Tutorial; $ demo $ _ g Feixin interface instance application code
Apsara stack 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 and separate them with commas (,) (159..., 159...), contact qq: 85431993 for more suggestions.
E-mail: threesky@gmail.com ';
$ Api = "this site interface:
Http://api.heqee.com/fetion? Username = Feixin mobile phone number & passowrd = Feixin mobile phone password & to = recipient's number & message = SMS content
Or
Http://api.heqee.com/fetion? U = Feixin mobile phone number & p = Feixin mobile phone password & t = recipient number & m = SMS content ";
If ($ demo! = ""){
If (! In_array ($ demo, array ("send", "code", "help", "api") {error ("Parameter error! ");}
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 ('Enter the number of the login mobile phone .');
Break;
Case $ send ['password'] = null:
Error ('Enter your mobile phone login password .');
Break;
Case $ send ['to'] = null:
Error ('Enter the number of the recipient's cell phone .');
Break;
Case $ send ['message'] = null:
Error ('Enter the text message 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
/*
Required php extensions: curl and simplexml
*/
Include "libs/fetion. class. php ";
# Set the Apsara stack account password
$ Username = "15900000000 ";
$ Password = "password ";
// Receive number. multiple numbers are separated by commas (,) (159, 159 ..)
$ Sendto = "15900000000,13400000000 ";
// Message content
$ Message = "I am from heqee.com ";
// Instantiate (required)
$ Fetion = new fetion ($ username, $ password );
// Send a Boolean response
$ Sms = $ fetion-> send ($ sendto, $ message );
If ($ sms ){
Echo "OK ";
}
Header (content-type: text/html; charset = utf-8); error_reporting (0); include .. /libs/fetion. class. php Tutorial; $ demo = $ _ g...