user3548499
user3548499

Reputation: 41

Adding base_url() to header

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

header('location: base_url(). page.php?x=3'); 

Upvotes: 4

Views: 5920

Answers (2)

Rashmy
Rashmy

Reputation: 125

I used this for delayed redirect in header:

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

Upvotes: 0

hsz
hsz

Reputation: 152226

Try with:

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

Upvotes: 8

Related Questions