diff --git a/show/common.php b/show/common.php index 4a7ff93..a345bdd 100644 --- a/show/common.php +++ b/show/common.php @@ -294,25 +294,27 @@ function send_sms($phone, $msg) } send_sms_dx($phone, $msg); } +if(!function_exists("send_sms_ek")) { + function send_sms_ek($mobile, $msg) + { + $appid = 'svcXhqBFtbvNS6GUVumSM8k0WarOLiOZ'; + $appkey = 'ex1JUa3xO3JFXB9k5OqULKYYoJz7A2nV'; + $msg = '【云中美食】'.$msg; + $sign = md5($appid.$mobile.$msg.$appkey); + $url = "https://sms.189ek.com/yktsms/send"; -function send_sms_ek($mobile, $msg) -{ - $appid = 'svcXhqBFtbvNS6GUVumSM8k0WarOLiOZ'; - $appkey = 'ex1JUa3xO3JFXB9k5OqULKYYoJz7A2nV'; - $msg = '【云中美食】'.$msg; - $sign = md5($appid.$mobile.$msg.$appkey); - $url = "https://sms.189ek.com/yktsms/send"; - - $c = curl_init($url); - curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); - 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, "appid={$appid}&mobile={$mobile}&msg=".urlencode($msg)."&sign={$sign}"); - curl_setopt($c, CURLOPT_TIMEOUT, 10); - curl_exec($c); - curl_close($c); + $c = curl_init($url); + curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); + 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, "appid={$appid}&mobile={$mobile}&msg=".urlencode($msg)."&sign={$sign}"); + curl_setopt($c, CURLOPT_TIMEOUT, 10); + curl_exec($c); + curl_close($c); + } } + function get_code($table, $zd, $len, $type, $pre = '') { global $db; while(1) { diff --git a/show/include/func.php b/show/include/func.php index 05e8aee..3129422 100644 --- a/show/include/func.php +++ b/show/include/func.php @@ -689,21 +689,22 @@ function send_yzm_atom($cellphone, $yzm) { //echo $s; } -function send_sms_ek($mobile, $msg) -{ - $appid = 'svcXhqBFtbvNS6GUVumSM8k0WarOLiOZ'; - $appkey = 'ex1JUa3xO3JFXB9k5OqULKYYoJz7A2nV'; - $msg = '【云中美食】'.$msg; - $sign = md5($appid.$mobile.$msg.$appkey); - $url = "https://sms.189ek.com/yktsms/send"; +if(!function_exists("send_sms_ek")) { + function send_sms_ek($mobile, $msg) { + $appid = 'svcXhqBFtbvNS6GUVumSM8k0WarOLiOZ'; + $appkey = 'ex1JUa3xO3JFXB9k5OqULKYYoJz7A2nV'; + $msg = '【云中美食】' . $msg; + $sign = md5($appid . $mobile . $msg . $appkey); + $url = "https://sms.189ek.com/yktsms/send"; - $c = curl_init($url); - curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); - 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, "appid={$appid}&mobile={$mobile}&msg=".urlencode($msg)."&sign={$sign}"); - curl_setopt($c, CURLOPT_TIMEOUT, 10); - curl_exec($c); - curl_close($c); + $c = curl_init($url); + curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); + 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, "appid={$appid}&mobile={$mobile}&msg=" . urlencode($msg) . "&sign={$sign}"); + curl_setopt($c, CURLOPT_TIMEOUT, 10); + curl_exec($c); + curl_close($c); + } } \ No newline at end of file