如何在重定向中发送参数-PHP Codeigniter [英] how to sent parameter in redirect - php codeigniter

查看:51
本文介绍了如何在重定向中发送参数-PHP Codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码给我一个错误。我想调用一个函数并使用php codeigniter将参数传递给它。

the following code gives me an error. I want to call a function and pass a parameter to it with php codeigniter.

redirect(base_url() . 'MainController/Student_Login($user_email)')

其中MainController是控制器名称,Student_Login是函数$ user_email是一个包含用户电子邮件ID的变量。我也尝试过通过url发送它。例如

here MainController is the Controller name, Student_Login is the function $user_email is a variable that holds the user email id. I have also tried sending it through url. e.g.

redirect(base_url() . 'MainController/Student_Login/.$user_email.')

请帮助。

推荐答案

有不需要添加带有重定向的 base_url

There is no need of adding base_url with redirect.

只需尝试

重定向('mainController / Student_Login /'.$ user_email)

user_email 时,您将在 student_Login 功能中收到作为参数的

when user_email you will receive as argument in student_Login funciton

这篇关于如何在重定向中发送参数-PHP Codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆