我想在重定向上显示内容更新的成功消息link.here是我的控制器代码:-
public function add_content()
{
$this->load->helper('url');
$id=$this->input->post('id');
$content=$this->input->post('content');
$title=$this->input->post('title');
我的代码点火器会话有问题。我正在使用CodeIgniter-3.1.8。我在配置中将autoload.php中的会话加载为
$autoload['libraries'] = array('database', 'session');
但它显示了一个类似于Unable to locate the specified class: Session.php的错误。
然后我从autoload.php中删除了它,并将其加载到控制器中。
public function __construct() {
parent::__construct();
我了解了flashdata,并决定使用它来显示基于数据库交互的消息。
例如,如果没有行受到影响,我希望显示Post id is invalid or does not exist!
在我的模型中
function delete_post($post_id)
{
$this->db->where('user_id', $user_id);
$this->db->where('post_id', $post_id);
$this->db->delete('posts&
我尝试使用$this->session->set_flashdata('success'),但在重定向到另一个函数后它不起作用。下面是我的代码:
<?php
class Home extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->helper(array('url','form');
$this->load->librar
我有一个会话flashdata的问题。从不显示包含会话的消息。我在这个页面上读了很多帖子。但是我没有找到解决这个问题的办法
我有这样的路由:
//index is a subfolder into the controllers folder
//user is a controller
$route['login'] = 'index/user/showLogin';
$route['do_login'] = 'index/user/doLogin';
$route['regis
我有一个问题,我需要插入功能,admin_list_students设置为只有管理员登录和访问这些功能或网页。然后我需要它,所以用户只访问user_list_students。目前,当用户登录时,他们也可以访问管理区域。我尝试设置两个不同的登录页面,但是当用户登录时,他们可以访问管理页面。
student.php控制器
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Student extends CI_Controller {
f
在控制器注册中
function signup() {
if('user already exists') {
$this->session->flashdata('flsh_msg', 'You have already signed up using goole. you will be redirected to home page.');
redirect('signup/signup/show_message');
}
}
在同一个控制器中显示消息,只是为了
我已经找到了一些例子,使上传可选,但到目前为止,它还没有对我起作用。我可能漏掉了什么所以我希望有人能抓住它?这是我下面的链接
到目前为止,我能够编辑的产品,如果我不上传一个文件,但如果我上传一个文件,我得到一个你没有选择一个文件上传错误。请帮帮忙。谢谢。
控制器
public function editProduct(){
$this->form_validation->set_error_delimiters('<p class="error">', '</p>');
$this-&