dongti7838 2018-12-19 06:48
浏览 93

如何在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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值