title: How to use PHP to Redirect to an url after the base_url
body: <p>I'm trying to use PHP to redirect to a page 5 secs after an action is done. I've searched up how to use header for this but want to get more info on incorporating base_url() into the code, so I won't need to change this script multiple times on different servers.</p>
  
  <p>Code:</p>
  
  <pre><code>$url=base_url().'page_I_want_to_go_to'
  header('Refresh: X; URL=$url');
  </code></pre>
  
  <p>This does redirect me to a link, but the url is not the url I was indicating with base and page I want to go to.</p>