duanli8391 2016-04-26 07:05
浏览 42
已采纳

Url在重定向时更改codeigniter

I am new in codeigniter.

I was trying to develop login page and its almost done but i do not know when i am trying to redirect page after successful login or redirecting after not successful login, the starting part of url localhost:81 changes to [::1]. I do not know why its happening i google it but i did not get proper way so please some one help me below i have mention my code.

Thank you in advance.


this is the controller code to verify Email and password

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class verifyLogin_controller extends CI_Controller {

function _construct(){
    parent::_construct();       
}

public function index()
{       

    if($_POST["submitLogin"])
    {
        $userEmail=$this->input->post('email');
        $password=$this->input->post('password');

        $verify_query = $this->db->from("admin");           
        $verify_query = $this->db->where(array("admin_userid" => $userEmail,"admin_password"=>$password));
        $verify_query = $this->db->limit(1);
        $res=$this->db->get()->result();            
        if($res != null)
        {

            redirect("homeHeader_controller/index");

        }
        else
        {

            redirect("adminLogin_controller/index");

        }

    }
}
}
  • 写回答

2条回答 默认 最新

  • doushi1510 2016-04-26 07:35
    关注

    Set your base_url:

    $config['base_url'] = 'http://localhost:81/';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号