Codeigniter change url if get is empty - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Codeigniter change url if get is empty (/showthread.php?tid=67761) |
Codeigniter change url if get is empty - wolfgang1983 - 04-05-2017 Codeigniter change url if get is empty When my get question id is empty http://localhost/project-ask/questions?question_id= It should switch back to http://localhost/project-ask/questions I have tried this below PHP Code: if (empty($this->input->get('question_id'))) { And a couple of other ways but not working keep getting message. This page isn’t working message Question if ?question_id= is in url but empty how to make sure it redirects to base_url('questions') PHP Code: <?php RE: Codeigniter change url if get is empty - noobie - 04-09-2017 Try using PHP Code: redirect('/project-ask/questions'); |