Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Url Change in codeigniter while redirecting

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");

        }

    }
}
}
like image 256
Darshan Dave Avatar asked Aug 24 '26 07:08

Darshan Dave


1 Answers

Set your base_url:

$config['base_url'] = 'http://localhost:81/';
like image 145
Narf Avatar answered Aug 26 '26 03:08

Narf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!