A quick question involving PHP development, I seem to be wondering about this more and more as I develop more complex sites. Basically say we have a basic PHP / XHTML inbox (messaging system). I perform checks at the top (check if user is logged in, check if user has correct permissions etc). Then use the ‘header(‘location:www.abc.com)’ function if the authentication fails. The question is do I write the rest of the inbox code in a huge ‘else’ block or just use standard html. I read somewhere about about it being bad to put any code after using the ‘header’ function.
A quick question involving PHP development, I seem to be wondering about this more
Share
Just follow your header with
Than it won’t be a problem.
see third example here
Also you don’t need a big echo like that, you can echo html like this aswell if you want: