I want to redirect the page if some condition returns true. I do not know how to do that. Can someone provide me an example?
Or is there a way to do this?
Use the redirect() function from > URL Helper .
redirect()
EDIT: download helper url:
$this->load->helper('url'); if (condition == TRUE) { redirect('new_page'); }
Use the helper function redirect ().
Example:
$this->load->helper('url'); if ($logged_in == FALSE) { redirect('/login/form/', 'refresh'); }
Try this code after if statement
redirect(site_url('/index'));
I hope this will be helpful to you.
$this->load->helper('url'); redirect(base_url('controller/function'));
or
redirect(base_url().'controller/function');
redirect('controller/function');
Source: https://habr.com/ru/post/1415701/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1415696/wt-c-adding-get-values-to-the-url&usg=ALkJrhi6WnuDDpUhTPfkZg8zhD2ob2KRrwCreating an android project from jenkins under linux - crash build, unable to find imported file build.xml - androidHow to debug Android project from git using Jenkins interface? - androidChecking python proxy list - pythonPut my node.js app online - node.jsIntersection of variable number of lists - functionpython text file processing - pythonHow to manage input events in a modular user interface? - javascriptMarking changed values ββfor converted data in ggplot2 - rSqlalchemy hybrids - sqlalchemyAll Articles