quamagocugh
New Member
On my localhost i have no problems but when i upload it to the online server i got the following error message when i try to login with a username and password:Warning: Cannot modify header information - headers already sent by (output started at /www/zzl.org/b/t/b/btblog/htdocs/index.php:9) in /www/zzl.org/b/t/b/btblog/htdocs/login_form.php on line 12I read something about that i should insert \[code\]ob_start()\[/code\] and \[code\]ob_flush()\[/code\] i did that in my index.php, but after i uploaded that nothing appeared , only a white blank page. Not sure what to do here. I could need some help please.EDIT: here is my index and login_form.php\[code\]<?phpsession_start(); ?><!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link type="text/css" rel="stylesheet" href="http://stackoverflow.com/questions/10558209/CSS/btstyle.css"> <script src="http://stackoverflow.com/questions/10558209/JS/jquery-1.7.2.js" type="text/javascript"></script> <script src="http://stackoverflow.com/questions/10558209/JS/reglogin.js" type="text/javascript"></script> <title></title> </head> <body> <header><h1 class="title">Welcome to My Website!</h1></header> <div id="container"> <div id="center" class="column"> <nav> <ul> <li><a href="http://stackoverflow.com/questions/10558209/#">Home</a></li> <li><a href="http://stackoverflow.com/questions/10558209/#">About Me</a></li> <li><a href="http://stackoverflow.com/questions/10558209/#">Say Hi!</a></li> <li><a href="http://stackoverflow.com/questions/10558209/#">Contact Me!</a></li> <li><a href="http://stackoverflow.com/questions/10558209/#">Else!</a></li> </ul> <br style="clear:left"/> </nav> </div> <div id="left" class="column"> <?php if (!isset($_SESSION['username'])) include('leftout.php'); else include('leftin.php'); ?> </div> <div id="right" class="column"> <div class="toprow"> </div> </div> </div> <footer>This is the Footer</footer> </body></html>\[/code\]and the login form:\[code\]<?php$check = 0;if(isset($_POST['login'])){ $check = 1; include('class_login.php'); $login = new class_login(); if ($login->isLoggedIn()) { header('location:index.php'); } else $login->show_errors();}$ltoken = $_SESSION['ltoken'] = md5(uniqid(mt_rand(), true));?><link rel="stylesheet" href="http://stackoverflow.com/questions/10558209/CSS/regstyle.css" type="text/css" /><script src="http://stackoverflow.com/questions/10558209/JS/jquery-1.7.2.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { var checker = <?php echo $check; ?>; if(checker == 1) { $("#logform").slideDown("fast") } }); </script><div id="content"><!-- Begin Form --><div class="form-content"><form class="reg-form" method="post" action="<?php $_SERVER['PHP_SELF'] ?>"> <fieldset> <div class="divusername"> <label for="username">Username:</label> <input type="text" id="username" name="username" placeholder="Your Username Here" /> </div> <div class="password"> <label for="password">Password:</label> <input type="password" id="password" name="password" placeholder="Your Password Here" /> </div> <div class="submit-button"> <input type="hidden" name="ltoken" value="http://stackoverflow.com/questions/10558209/<?php echo $ltoken; ?>" /> <input type="submit" name="login" value="http://stackoverflow.com/questions/10558209/Login" /> </div> </fieldset></form></div></div>\[/code\]