I have one file index.php that im using like layout. In the middle of the file i have other php file that controls which file to be displayed depending from the task in the URL. So when i i want to display the login form i just call login.php script inside the index.php file.
My question how can i set cookies or something else that require headers not to be sent.
I can't from that file login.php because is always in after the headers are sent (it is in the middle of the layout file index.php)
Maybe someone to recommend some other structure or some solution
Thank You in advance