Forum Moderators: coopster
<body>
<div id="title">
<a href="mindex.php"><img src="img/mtitle.gif"</a>
</div>
<?php
include("/data/validate/login.php");
if (isset($_POST['submitted']))
{
//This function has been set to return FALSE no other code
$noUser = valUser ($_POST['uName'], $_POST['pass']);
if ($noUser==true)
{
//No User Found
echo ("<div id=\"error\">Account not found, please try again</div>");
}
else
{
//user successfully authenticated
header("Location:/data/individual/in_home");
exit();
}
}
?>
//The login form is after this code
I get the error header already sent from the same line. Please help, I'm a stumped NEWBIE
<?php
include ("data/validate/login.php");
$noUser=false;
if (isset($_POST['submitted']))
{
$noUser = valAccount($_POST['uName'], $_POST['pass']);
if ($noUser=="false")
{
header("Location:data/individual/in_home.php");
exit();
}
}
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<link href="css/hhcss.css" rel="stylesheet" type="text/css" media="handheld" />
</head>
<body>
<div id="title">
<a href="mindex.php"><img src="img/mtitle.gif" /></a>
</div>
<?php
if (isset($_POST['submitted']))
{
if ($noUser=="true")
{
echo ("<div id=\"error\">Account not found, please try again</div>");
}
}
?>
You figured it out. You must not send any output to the browser first, not even blank spaces. Details on the header [php.net] manual page.