亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在codeigniter中運行帶參數的表單?

如何在codeigniter中運行帶參數的表單?

PHP
呼啦一陣風 2023-08-11 17:11:46
我是 codeigniter 的新手,我想在用戶插入號碼時在視圖中運行我的短信網絡服務代碼。但post方法是空的!誰能幫我?var_dump($_POST['sendSms']);exit;            if(array_key_exists('sendSms', $_POST)) {                sendSms();            }function sendSms(){ //my sms web service code}echo '<form  method="Post" action= "http://crm.oynarco.ir/admin/settings?group=sms">';            ?>            <input type="hidden"               name="<?php echo $this->security->get_csrf_token_name()?>"               value="<?php echo $this->security->get_csrf_hash()?>">            <?php            echo '<input type="hidden" name="username" value="09172030433"/><br />';            echo '<input type="hidden" name="password" value="Oynar1234" /><br />';            echo '<input type="text" name="to" class="form-control test-phone" placeholder="'._l('staff_add_edit_phonenumber').'" /><br />';            echo '<textarea type="text" name="text" class="form-control sms-gateway-test-message" placeholder="'._l('test_sms_message').'" ></textarea><br />';            echo '<input type="text" name="From" class="form-control" value="5000203069627" /><br />';            echo '<input type ="submit" name="sendSms" class="btn btn-info send-test-sms" value="'._l('send_test_sms').'" />';            echo '</form>';
查看完整描述

1 回答

?
Helenr

TA貢獻1780條經驗 獲得超4個贊

在操作 root 到控制器中,然后在控制器中獲取 post 方法并添加您的短信功能。


?>

            <form  method="Post" action= "settings/sendSms">

            <input type="hidden" 

              name="<?php echo $this->security->get_csrf_token_name()?>" 

              value="<?php echo $this->security->get_csrf_hash()?>">

            <?php

            echo '<input type="hidden" name="username" value = "09172030433"/><br />';

            echo '<input type="hidden" name="password" value ="Oynar1234" /><br />';

            echo '<input type="text" name="to" class="form-control test-phone" placeholder="'._l('staff_add_edit_phonenumber').'" /><br />';

            echo '<textarea type="text" name="text" class="form-control sms-gateway-test-message" placeholder="'._l('test_sms_message').'" ></textarea><br />';

            echo '<input type="text" name="From" class="form-control" value = "5000203069627" /><br />';

            echo '<input type ="submit" name="sendSms" class="btn btn-info send-test-sms" value = "'._l('send_test_sms').'" />';

            echo '</form>';

在控制器中:


public function sendSms(){

    //var_dump($_POST);exit;

    if (isset($_POST) ){

        //send sms

    }


查看完整回答
反對 回復 2023-08-11
  • 1 回答
  • 0 關注
  • 118 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號