如何在php codeigniter 3中将表单数据添加到动态字符串中

PHP -> CODEIGNITER

Tables - users [customers information] - sms gateway [sms gateway configuration apiKey, sender code] - sms template [ pre-approved dynamic templates eg, visitor to office]

Form - fullname [input field] = SHREYAS - Phone [input field] = 123456789 - service [dynamic dropdowm from services table] = ABC - remark = QWERTY

** Form Submitted ** 1) $post = $this->input->post(); [PHP codeigniter syntax for controller]

2) $data[] = $post[]; [all the form data is stored in array called data]

3) inserted data to db [visitors]

** sending sms to visitor ** 1) $users_id = $this->session->userdata('users_id'); [PHP codeigniter syntax for getting users_id from session]

2) get_sms_gateway_details [of customer where users_id = $users_id]

3) $sms_content[users_id,sms_gateway_id,TITLE] // getting the template with users_id sms_gateway_id and title("visitors")

4) $sms_content is added in foreach loop to get visitors template message as string in $message

******** Problem I am facing ********

5) $message = Dear '.$post['fullname'],', Your request for '.$service_name.' is in progress. Our team will get back to you soon. Have a Great Day !!!. mob: +91

0000000000. ("this is the sms template used for visitors in which $post['fullname'] should be SHREYAS and $service_name = ABC" which was submitted in form above)

6) Final output required = Dear SHREYAS, Your request for ABC is in progress. Our team will get back to you soon. Have a Great Day !!!. mob: +91 0000000000.

7) later this will be added to sms_data_array[] and will be sent using PHP CRUL method

dougang6821
dougang6821 我理解您的担忧,但我面临的问题需要更多解释。无论如何,谢谢你解决这个问题
接近 2 年之前 回复
duanjue7508
duanjue7508 请阅读如何创建最小,完整和可验证的示例
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐