duanaoyuan7202 2016-08-25 06:15
浏览 34
已采纳

如何在codeigniter 3中的url中传递和获取变量

How can i send variables in the url using codeigniter. I already read some forums but i didn't find the correct syntax for it.

Here is the format i want to have in the url

http://localhost/acc/index.php/Jev/entryAccount/2016-08-0042

your help is very much appreciated. Thank you.

  • 写回答

2条回答 默认 最新

  • dqrm8199 2016-08-25 06:26
    关注

    Try this:

    first you put your variables in query string like this:

    redirect('mycontroler/senddata/'.$name.'/'.$email);
    

    In controler receive parameters in this way:

    public function senddata($name,$email)
    {
       // do you stuff here
    }
    

    Or to receive parameter you can use:

    $this->uri->segment(number);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 hfss 组天线阵列报错:The A and B vectors must be parallel to the XY plane,如何解决?
  • ¥30 ansible连接设备报错
  • ¥60 pmsampsize包取值问题
  • ¥15 波形合成电路的设计学习
  • ¥15 unity脚本挂不上
  • ¥15 数学建模数学建模需要
  • ¥20 Java Sound Api 调用Mixer.getLine偶现Line unsupported错误。
  • ¥15 使用cuda加速opencv运算但是报错AttributeError: module 'cv2.cuda' has no attribute 'getCudaEnabledDeviceCount'
  • ¥15 java输入输出异常
  • ¥15 三子连珠对弈小游戏制作