How to get current url with query string in codeigniter?By Hardik Savani | August 29, 2016 | | 2218 Viewer | Category : Codeigniter
Share this post:
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;
- Install Sublime Text 3 in Ubuntu 14.04 using Terminal
- PHP - How to Convert file(image, audio, video) extension using CloudConvert API?
- How to get year, month and day from timestamp date using carbon in Laravel 5?
- How to set global view variables using composer share in Laravel 5?
- AngularJS - simple image upload with preview example in PHP
- How to get last executed query in Larave 5?
- Bootstrap - maxlength validation with count remaining character example
- PHP - How to make dependent dropdown list using jquery Ajax?