How to Get Current URL with Query String in Codeigniter?
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:
$currentURL = current_url();
$params = $_SERVER['QUERY_STRING'];
$fullURL = $currentURL . '?' . $params;
I hope it can help you...
We are Recommending you
- Codeigniter Curl Post Request with Parameters Example
- How to Get Current Month Records in Codeigniter?
- Codeigniter Form Validation with Error Message
- Codeigniter Add/Remove Multiple Input Fields Dynamically using JQuery
- How to Get form Post Data in Controller Codeigniter?
- How to Get All Tables List in Codeigniter?
- Codeigniter Implement Fullcalendar Example Tutorial
- Codeigniter Ajax Pagination using JQuery Example
- Codeigniter Resize Image and Create Thumbnail Example
- Codeigniter Select2 Ajax Autocomplete from Database Example
- How to Get Current URL in Codeigniter?
- How to Get Current URL in Laravel?
- How to Get IP Address in Codeigniter?
- Codeigniter 3 and AngularJS CRUD with Search and Pagination Example.