Answers for "codeigniter 4 get full url without index.php"

1

get current url in codeigniter

simple get like this

echo $this->input->get('my_id');
Load the URL helper To get current url

$currentURL = current_url(); //http://myhost/main

$params   = $_SERVER['QUERY_STRING']; //my_id=1,3

$fullURL = $currentURL . '?' . $params; 

echo $fullURL;   //http://myhost/main?my_id=1,3
Posted by: Guest on March-03-2021
0

fix working base_url for local and server both in codeigniter

$config['base_url'] = "http://".$_SERVER['SERVER_NAME']."/project_name/";
this way you config you base_url , then won't worry about in hosting. both works in localhost and server.
Posted by: Guest on June-10-2020

Code answers related to "codeigniter 4 get full url without index.php"

Browse Popular Code Answers by Language