I have just switching hosting. Everything used to work fine. I have now copied all the files onto the new ftp server, set up the database, etc. however I get these messages on every page:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/pesterlo/public_html/core/init.inc.php:15) in /home/pesterlo/public_html/core/init.inc.php on line 23
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/pesterlo/public_html/core/init.inc.php:15) in /home/pesterlo/public_html/core/init.inc.php on line 23
Warning: Cannot modify header information - headers already sent by (output started at /home/pesterlo/public_html/core/init.inc.php:15) in /home/pesterlo/public_html/core/init.inc.php on line 36
Here is the init.inc.php file (-database connection):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="ext/css/main.css" />
<title>PesterLog</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="72x72" href="apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="apple-touch-icon-114x114.png" />
<script type="text/javascript" src="http://pesterlog.tk/core/pages/js/jquery_1.5.2.js"></script>
<script type="text/javascript" src="http://pesterlog.tk/core/pages/js/loaded_contents.js"></script>
</head>
<?php
date_default_timezone_set('Europe/London');
$core_path = dirname(__FILE__);
if (empty($_GET['page']) || in_array("{$_GET['page']}.page.inc.php", scandir("{$core_path}/pages")) == false){
header('HTTP/1.1 404 Not Found');
header('Location: index.php?page=inbox');
die();
}
session_start();
echo mysql_error();
//connects to database
include("{$core_path}/inc/user.inc.php");
include("{$core_path}/inc/private_message.inc.php");
if (isset($_POST['user_name'], $_POST['user_password'])){
if (($user_id = validate_credentials($_POST['user_name'], $_POST['user_password'])) !== false){
$_SESSION['user_id'] = $user_id;
header('Location: index.php?page=inbox');
die();
}
}
if (empty($_SESSION['user_id']) && $_GET['page'] !== 'login'){
header('http/1.1 403 Forbidden');
header('location: index.php?page=login');
die();
}
$include_file = "{$core_path}/pages/{$_GET['page']}.page.inc.php";
?>
Please help me.
Thank you in advance