php - 如何在 CodeIgniter 中重定向页面?

标签 php codeigniter redirect

我想在某些条件返回 true 时重定向页面。我不知道该怎么做。谁能给我举个例子吗?

或者有什么办法可以做到这一点?

最佳答案

使用 URL Helper 中的 redirect() 函数.

编辑: 加载 url 帮助程序:

$this->load->helper('url');
if (condition == TRUE) {
   redirect('new_page');
}

关于php - 如何在 CodeIgniter 中重定向页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10861164/

相关文章:

python - Scrapy 立即跟随 302 重定向

redirect - 带有缓存响应 header 的 IIS 重定向

mysql : Best way to deal with data like average rating of restaurants etc?

php - Angularjs + Codeigniter 用户身份验证

php - 在存储过程中调用函数时出现错误

URL映射、URL重定向/重写

php - 如何根据服务时间禁用时段?

php - 将参数传递给来自 url 的 select 语句

php - 信用点 Web 应用程序

javascript - XMLHttpRequest() POST 返回 405 错误;不允许的方法