I am having real trouble trying to put my PHP scripts into my webpage. All the files work as just PHP files but once I have started to put them into my actual webpage its all gone wrong.
I understand the problem but can’t fine a fix t the problem.
The problem is this
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\swiftdist\website\loginsuccess.php:8) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\swiftdist\website\includes\scripts\loginsuccess.php on line 2
Welcome to the site test lets just see The last time you were here was
Now I know I can fix this by moving my include file (loginsucess.php) to the top of the page however if I do this it doesn’t fit into my webpage design. What do I need to change so that I can fit my php into my webpage and so that it all looks correct.
Loginsucess Page
<?php
session_start();
if(!isset($_SESSION["username"])){
header ( 'location: index.php' );
exit;
}
else {
echo "Welcome to the site " . $_SESSION["username"] . " lets just see " . $_SESSION["salesimage"] . " The last time you were here was " . $_SESSION["timestamp"] . "";
}
?>
HTML Page with Includes
<!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>Swift Distributors</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="homepage.css" />
<link rel="stylesheet" type="text/css" href="navigation/navigationhoro.css" />
</head>
<body>
<div id="outer">
<div id="header"><?php include("includes/design/headerlinks.php"); ?></div>
<div id="centrecontent">
<div id="right">
<h1 class="h1">Welcome To Swift Distributors</h1>
<p class="p"><?php include("includes/scripts/loginsuccess.php"); ?></p>
</div>
<div id="left"><?php include("includes/design/leftmenu.php"); ?><?php include("includes/scripts/login.php"); ?></div>
</div>
<div class="clearer"></div>
</div>
<div id="footer"><?php include("includes/design/footer.php"); ?></div>
</body>
</html>
Cheers for any help