using header() is good in this context
<p>I have a user who registered on my website with some email and password. As soon as he registers we will send a confirmation code to his email and ask him to enter the number to sign up.</p>

<p>Unfortunately there is a possibility that the user may fill the data and may logoff today without entering the confirmation code and he may come back tomorow and login with his registered email. So I would check his email in the database and if he is registered and if his email is under the approval of code sent to his email then I want to redirect him to a page indicating that "a code has been sent to your email respond to your code to sign up" else if he is already registered and there is no pending approvals then redirect him to his profile.</p>

<p>I am not sure the way to do it. I was thinking to use this: if user is under approval then <code>header('location confirmation.php')</code> and if he is approved then <code>header('location profile.php')</code> but I'm not sure if this is the right way to do it. Can headers be used for this purpose? or what is the alternate solution to do it. Please help me with this, thanks.</p>
