| Redirect Stumped Redirecting from login success |
mafaz

msg:3895109 | 9:54 am on Apr 18, 2009 (gmt 0) | <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
|
mafaz

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

msg:3895115 | 10:26 am on Apr 18, 2009 (gmt 0) | 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>"); } } ?>
|
coopster

msg:3895132 | 11:30 am on Apr 18, 2009 (gmt 0) | 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.
|
|
|