I have been trying to resolve this problem with all online solutions several days, and nothing was helpful. Obviously I am missing a key point as on localhost it works, but when I put it online it does not.
ERROR: Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/public_html/domain/index.php:1) in /home/public_html/domain/index.php on line 3
index.php
<?php
session_start();
include('functions/connect.php');
$page = htmlentities($_GET['page']);
include('functions/' . $page . '.func.php');
$pages = scandir('pages');
if (!empty($page) && in_array($_GET['page'] . '.php', $pages)) {
$content = 'pages/' . $_GET['page'] . '.php';
} else {
header('Location:index.php?page=register');
}
if (isset($_SESSION['uesername'])
) {
header("Location:index.php?page=member");
}
?>
<!DOCTYPE html>
<html>
<head>
<link href="css/mojcss.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id='content'>
<?php
include($content);
?>
</div>
</body>
</html>
connect.php
<?php
$link = @mysql_connect('localhost','myusername','mypass'); //or die('error');
if(!$link)
{
$message="<strong><font color='red'>Error, try later.</font></strong><br /><br />";
die($message.mysql_error());
}
$db = mysql_select_db('mydb'); //or die('unable to connect');
if(!$db)
{
$message="<strong><font color='red'>Error, try later.</font></strong><br /><br />";
die($message.mysql_error());
}
?>