Is it possible to pass a query string through base_url() function in codeigniter?
I would like to add ?login=1 to the base url which user arrives at after being redirected in this function:
redirect(base_url());
This is done with simple string concatenation.
redirect(base_url().'?login=1');
and as per the documentation, you can indeed pass a string into the base_url() function:
redirect(base_url('?login=1'));
Although it isn't designed for this purpose - it's supposed to be used for segments so functionality with a query string passed into the function isn't guaranteed.