|
Posted by Jeff on 01/11/07 15:24
"Peter Boosten" <nobody@nowhere.invalid> wrote in message
news:eo5fgd$s74$1@news3.zwoll1.ov.home.nl...
> Jeff <it_consultant1@hotmail.com.nospam> wrote:
>> <?php
>> session_start();
>
> The space before 'session_start' is the cause of your problems...
>
> Peter
>
> --
> http://www.boosten.org
>
> Mail: peter at boosten dot org
I still get the error, but I get it on another place in the code.:
Warning: Cannot modify header information - headers already sent by (output
started at C:\Inetpub\wwwroot\Demo\index.php:17) in
C:\Inetpub\wwwroot\Demo\login.php on line 10
Sorry, I didn't post the entire index.php in the previous post, but I didn't
think the entire file was relevant... But I post it now... I still get this
error when trying to login. This is the URL I use
http://localhost/Demo/index.php?mode=login when I get the error.
Any suggestions?
************* complete index.php *********************
<?php
session_start();
if ($_GET["mode"] == "logout") {
header("Location: index.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DEMO</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="menu.css" media="all" />
<link rel="stylesheet" type="text/css" href="stylesIE.css" media="all" />
<link rel="stylesheet" type="text/css" href="formsIE.css" media="all" />
</head>
<body>
<div id="mainContainer" style="width:100%;">
<div id="headerContainer">
<div id="login">
<?php
if (strcmp($_SESSION["user"], "New User") == 0 ) {
echo '<a href="index.php?mode=profile">Hello World</a>  ';
echo '<a href="index.php?mode=logout">Logg ut</a>';
}
else {
echo '<a href="index.php?mode=reg">Registrer deg</a>  ';
echo '<a href="index.php?mode=login">Logg in</a>';
}
?>
</div>
</div>
<div id="menu">
<ul>
<li id="current"><a href="index.php">Velkommen</a></li>
<li><a href="#">Kontakt Oss</a></li>
<li><a href="#">Hjelp</a></li>
</ul>
</div>
<?php
if ($_GET["mode"] == 1)
include 'search.php';
else if ($_GET["mode"] == "reg")
include 'registration.php';
else if ($_GET["mode"] == "login")
include('login.php');
else if ($_GET["mode"] == "logout")
include ('logout.php');
else if ($_GET["mode"] == "profile")
include 'profile.php';
else
include 'home.php';
?>
<div id="footer">
Hello World
</div>
</div>
</body>
</html>
Navigation:
[Reply to this message]
|