Forum Moderators: coopster
this is my code:
<?php
/* Include Files *********************/
session_start();
include("new_database.php");
include("new_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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login ¦ #*$!</title>
<link rel="stylesheet" type="text/css" href="css/common.css">
<link href="vista_toolbar/style.css" media="all" rel="stylesheet"
type="text/css" />
<style type="text/css">
<!--
body {
background-image: url(images/back.jpg);
background-color: #CCEEF8;
background-repeat: repeat-x;
}
-->
</style></head>
<!--<body class="twoColFixRtHdr">-->
<body>
<?php
session_start();
@include_once("new_database.php");
@include_once("new_login.php");
?>
<br>
<div id="container">
<div><?php @include_once("ui_main-menu.php")?></div>
<div id="mainContent">
<?php displayLogin(); ?>
</div>
<!--<br class="clearfloat" />-->
<div><?php @include_once("ui_footer.php")?></div>
<!-- end #container --></div>
</body>
</html>
here:
ui_main-menu.php: acts like a header in all the pages.where there r links to different pages.
displayLogin(): is a function within new_login.php
Pls help me out
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home ¦ MySite</title>
<link rel="stylesheet" type="text/css" href="css/common.css">
<link href="vista_toolbar/style.css" media="all" rel="stylesheet"
type="text/css" />
<style type="text/css">
<!--
body {
background-image: url(images/back.jpg);
background-color: #CCEEF8;
background-repeat: repeat-x;
}
-->
</style></head>
<body class="twoColFixRtHdr">
<br>
<div id="container">
<div><?php @include_once("ui_main-menu.php")?></div>
<div id="sidebar1">
<h3>Not a member yet? Sign up here</h3>
<p>Sign up here: <a href="cafe.php">Register</a></p>
</div>
<div id="mainContent">
<h1>Sign in Here: </h1>
<? displayLogin(); ?>
</div>
<br class="clearfloat" />
<?php @include_once("ui_footer.php")?>
</div>
</body>
</html>
////////////////////////////////////////////////////////////////////
this is the error I get:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\AppServ\www\saberplex\trunk\login.php:1) in D:\AppServ\www\saberplex\trunk\login.php on line 3
Pls tel me why I get this error?
Also inclued or require should take the following format:
include 'filename.php';
include_once 'filename.php';
require 'filename.php';
require_once 'filename.php';
See [uk3.php.net...]
You can`t send any data to the browser before calling session_start. It works like the header function. This can include whitespace. You might want to read up on how sessions work:
[uk3.php.net...]
dc
I dnt think there's a prob with the way wit 'include'. thnx
<?php @include_once("ui_footer.php")?>
That is wrong. It should be:
<?php @include_once("ui_footer.php"); ?>
You have two of them with the semi-colon missing, and that's causing an error. That's what you have to fix first, before looking any further.
So (even though it works):
<?php @include_once("ui_footer.php"); ?>
should be:
<?php @include_once 'ui_footer.php'; ?>