Welcome to WebmasterWorld Guest from 54.163.68.15

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Redirect Stumped

Redirecting from login success

   
9:54 am on Apr 18, 2009 (gmt 0)

5+ Year Member



<head>
<title>VPO</title>
<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
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

10:01 am on Apr 18, 2009 (gmt 0)

5+ Year Member



Please note that there is a message printed in a div when the username is not valid
10:26 am on Apr 18, 2009 (gmt 0)

5+ Year Member



for those who myt be in the same situ:

<?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>");
}
}
?>

11:30 am on Apr 18, 2009 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld, mafaz.

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.