Getting this error in the below code
Warning: Cannot modify header information – headers already sent by (output started at /home/kvkprose/public_html/index.php:48) in /home/kvkprose/public_html/header.php on line 15
Warning: Cannot modify header information – headers already sent by (output started at /home/kvkprose/public_html/index.php:48) in /home/kvkprose/public_html/header.php on line 16
Warning: Cannot modify header information – headers already sent by (output started at /home/kvkprose/public_html/index.php:48) in /home/kvkprose/public_html/header.php on line 17
Warning: Cannot modify header information – headers already sent by (output started at /home/kvkprose/public_html/index.php:48) in /home/kvkprose/public_html/header.php on line 18
$connection = new mysqli("127.0.0.1","*******","******","*********");
if ($connection->connect_error)
{
die("Connection failed: " . $connection->connect_error);
}
function exe_query($conn, $query)
{
$result = mysqli_query($conn, $query);
if (!$result)
{
die("Query failed: " . mysqli_error($conn));
}
$rows = [];
while ($row = mysqli_fetch_assoc($result))
{
$rows[] = $row;
}
return $rows;
}
$company_data=exe_query($connection, "select * from tbl_admin");
$contact_data=exe_query($connection,"select * from tbl_contact");
$about_data=exe_query($connection,"select * from tbl_about where id=3");
$social_data=exe_query($connection,"select * from tbl_social where id=1");
$full_name = $_SERVER['PHP_SELF'];
$name_array = explode('/',$full_name);
$count = count($name_array);
$page_name = $name_array[$count-1];
header("Strict-Transport-Security:max-age=63072000");
header("X-XSS-Protection: 1; mode=block");
header('X-Content-Type-Options: nosniff');
header("Expect-CT: enforce; max-age=30; report-uri='**********");
$mypage=explode(".",$page_name);