I have a .php file, say "index.php" . This file is being generated dynamically and I want to add the following code at the beginning of the file.
<?php
session_start();
require_once('login/auth.php');
require_once('config.php');
?>
Intention is to force user to sign up or sign in before they see this file. But I wasted a whole day and turned into nothing as resultant file is blank. what I found is , its facing problem with <?php and ?>
if I replace them with their equivalent entities <?php and ?> then they gets added easily but its not what I wanted.
So , question is how to add this original code to the beginning on file dynamically. Can someone help please?
session_startto error out because headers are already sent.