4

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

header('location: base_url(). page.php?x=3'); 
Amal Murali
  • 73,160
  • 18
  • 123
  • 143
user3548499
  • 41
  • 1
  • 2
  • If you're trying to build the a `base_url()` function, [this answer](http://stackoverflow.com/a/17201261/1438393) should get you started. The code in your question isn't working because you can't call functions inside single-quotes. Use concatenation as shown in @hsz's answer. – Amal Murali Apr 18 '14 at 10:18
  • @AmalMurali, I think OP is using the `base_url()` of the CI framework. – Shankar Narayana Damodaran Apr 18 '14 at 10:19
  • @ShankarDamodaran: I'm aware of the function, but I wasn't sure if the OP was using CI (as the question wasn't tagged so). – Amal Murali Apr 18 '14 at 10:20
  • @Christian How do you know that the OP uses CI framework? Please don't add tags unless it's obvious that the question is related to that specific tag. – Amal Murali Apr 18 '14 at 10:27

2 Answers2

7

Try with:

header('Location: ' . base_url() . '/page.php?x=3'); 
hsz
  • 143,040
  • 58
  • 252
  • 308
0

I used this for delayed redirect in header:

header('Refresh:5; url= '. base_url().'/YOURcontrollerName_or_functionName'); 
Rashmy
  • 125
  • 7