Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function sendBulkSms() {
- $config['upload_path'] = 'bulk_sms/';
- $config['allowed_types'] = 'txt';
- $this->load->library('upload', $config);
- if ($this->upload->do_upload('text_file')) {
- $upload_data = $this->upload->data();
- //------------------send sms---------------
- $file_content = file_get_contents(base_url()."bulk_sms/".$upload_data['file_name']);
- $mobileNO = explode(',', $file_content);
- //$mobileNO = array("8801670750680", "8801942762160");
- $smsFormat = "Hi, this is a test message";
- function httpGet($url) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec($ch);
- curl_close($ch);
- return $output;
- }
- $user = "aclandctg";
- $pass = "CTgAcLAnd87%23_";
- $sid = "8804445650490";
- $url = "my_sms_api_url";
- $SMSText = urlencode($smsFormat);
- foreach($mobileNO as $mobile_no){
- echo httpGet("my_sms_api_url?user=$user&password=$pass&sender=$sid&SMSText=$SMSText&GSM=$mobile_no&type=longSMS&datacoding=1");
- }
- // -----------end send sms----------
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement