my index.php
page code is-
<?php
if(!$_COOKIE['authorized'] == 1) {
header("Location: login.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Photo Website</title>
<script src="js/jquery-1.2.6.pack.js" type="text/javascript"></script>
<script src="js/jquery.lightbox-0.5.pack.js" type="text/javascript"></script>
<script src="js/myscript.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/default.css" />
<link rel="stylesheet" href="css/jquery.lightbox-0.5.css" />
</head>
<body>
<form method="post" action="changePhotoTitle.php">
<div id="container">
<h1>My Photos <small>click on the text to change the title.</small></h1>
<a href="login.php?logout=1" id="logout">logout</a>
<div id="main">
<?php require 'getPhotos.php'; ?>
<div id="response" class="hidden" />
</div><!-- end main-->
</div><!-- end container-->
</form>
</body>
</html>
my database.php page code is-
<?php
$db_name = "db";
$db_server = "localhost";
$db_user = "root";
$db_pass = "";
$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name) or die(mysqli_error());
?>
but followong warning message is coming- Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\pics\index.php:1) in C:\xampp\htdocs\pics\index.php on line 4