Common Mistake By Developer

There are mainly 3 type of error in php.

Fatal Error
Warning Error
Notice Error

Generally Rest of the program execute successfully even if a warning error show.I am going to give a example of warning error which i faced yesterday.
Warning: Cannot modify header information – headers already sent

Below is the code when i redirect a page by using header function.

if(mysql_query($sql))
{

header(“location:http://localhost/HostelAdmin/pages/admissionView.php”);

}

To avoid such type of problem what should we do?

1.Do not use echo /print statement before this header function.

2.Do not use white space before

Leave a Reply

Your email address will not be published. Required fields are marked *