I am using PHP 5.6
.
Recently, I have moved my projects to a new server and since then I am facing a strange problem.
The redirects
using php
header('Location:some_url')
is not working if there is a space
or tab
is there before opening of php
tag (<?php
) or after closing php
tag (?>
) into a php file on which user is being redirected. It returns blank page
.
It happens in only files which contains pure php
codes, no javascript, jquery, or html there in the file.
Sometimes the issues is like, suppose there is a file a.php
e.g.
<?php
// some statements here and end of php tag
?>
<?php
// opening of php tag and statements here and end of php tag
?>
Now, technically it should work but it is not working unless I remove the closing and opening php tag
from the middle of the file. There are several files are there containing such a codes. Please let me know how to fix it?