How to get current url with query string in codeigniter?
In this post we will give you information about How to get current url with query string in codeigniter?. Hear we will give you detail about How to get current url with query string in codeigniter?And how to use it also give you demo for it if it is necessary.
If you require to get current URL with parameters in your codeigniter project then you can get easily using “url” helper. Codeigniter provide url helper library that way we can get existing page url or base url etc. you can also get only parameters without URL using “input” as like bellow.
$parameters = $this->input->get();
But, we are getting full path using “url” helper and $_SERVER variable. So, you can see how to get full path using both as bellow:
Example:
$this->load->helper('url');
$currentURL = current_url();
$params = $_SERVER['QUERY_STRING'];
$fullURL = $currentURL . '?' . $params;
print_r($fullURL);
Hope this code and post will helped you for implement How to get current url with query string in codeigniter?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs