Adding base_url () to the header

Is it possible to have something like the following, but which really works?

header('location: base_url(). page.php?x=3'); 
+4
source share
2 answers

Try:

header('Location: ' . base_url() . '/page.php?x=3'); 
+6
source

I used this for deferred forwarding in the header:

header('Refresh:5; url= '. base_url().'/YOURcontrollerName_or_functionName'); 
0
source

Source: https://habr.com/ru/post/1537078/


All Articles