0

i am using this code o direct users to another page, the header function works well on my test server but wont work when i import to a live server. what am i doing wrong?

if (isset ($_POST['submit1']))
{   
    $_SESSION['user_session']= $user_session;
    header ("location: profilereg.php ");


}

I have even tried changing the page the header is pointing to, but it still doesn't work, could it be an error from the variable i am trying to pass to the next page? or am i missing something here?

  • 1
    Have you looked in the error logs? – Jay Blanchard Nov 07 '16 at 15:59
  • 99.9% chance that your error isn't in the code block, but somewhere else. You'll need to make sure you don't have as much as an errant space before, say, your opening ` – Machavity Nov 07 '16 at 16:14
  • Thanks, i have found the problem. Apprentely i used an ''echo'' statement somewhere before the '''header''. This means that when using ''header'' an ''echo'' statement must not preceede it. – Austine Nov 08 '16 at 07:51

0 Answers0