I have a page index.php where user enters name and this name is passed in session to negative.php . On loading negative.php it performs few calculations and displays the data. when i directly run negative.php (with session as null value) i want to redirect it to index.php.
This is my code: negative.php:
$(document).ready(function()
{
.....
.....
}
$name=$_SESSION['name'];
if($name=="")
{header("Refresh:0;url='http://lilly.co.in/index.php'");}
its giving error as:
Unknown error type: [2] Cannot modify header information - headers already sent by (output started at /mnt/drive2/homeb/home/lilly/www/negativ.php:421)
In my line 421 i have only <?php
Please help