41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?
|
|
if (!function_exists('send_sms_dx')) {
|
|
function send_sms_dx($num, $content) {
|
|
$enkey = 'jc9@aKONMRC!dhsi';
|
|
|
|
if (strpos($content, '[') === false && strpos($content, '【') === false) {
|
|
$content = "【云中美食】" . $content;
|
|
}
|
|
|
|
$post = $num.'#gsmsc#'.$content;
|
|
|
|
$encrypter = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
|
|
|
|
$blocksize = mcrypt_enc_get_block_size($encrypter);
|
|
$padding = $blocksize - strlen($post) % $blocksize;
|
|
$padding_text = str_repeat(chr($padding), $padding);
|
|
$post .= $padding_text;
|
|
|
|
$iv = substr($enkey, 0, 16);
|
|
mcrypt_generic_init($encrypter, $enkey, $iv);
|
|
$ciphertext = mcrypt_generic($encrypter, $post);
|
|
mcrypt_generic_deinit($encrypter);
|
|
mcrypt_module_close($encrypter);
|
|
|
|
$url = "https://cp.fsecity.com/xz/9e0f2d8926b/know/17111web/send.php"; //公网
|
|
|
|
$c = curl_init($url);
|
|
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
|
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
|
|
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 5);
|
|
curl_setopt($c, CURLOPT_TIMEOUT, 5);
|
|
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
|
|
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
|
|
curl_setopt($c, CURLOPT_POST, 1);
|
|
curl_setopt($c, CURLOPT_POSTFIELDS, bin2hex($ciphertext));
|
|
$content = curl_exec($c);
|
|
curl_close($c);
|
|
return $content;
|
|
}
|
|
}
|