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 交替优化波束形成和ris反射角使保密速率最大化
    • ¥15 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程