daveoffy Posted July 9, 2009 Share Posted July 9, 2009 I am having the following error: Warning: Cannot modify header information - headers already sent by (file) 19,20,22. <?php require_once('../include/config.php'); $username = $_POST['username']; $password = $_POST['password']; if($login == '') { echo 'Username is missing'; } if($password == '') { echo 'Password missing'; } $qry = "SELECT * FROM u_info WHERE username='$username' AND password='".md5($password)."'"; $result=mysql_query($qry); if($result) { if(mysql_num_rows($result) == 1) { if (isset($_POST['rememberme'])) { setcookie('username', $_POST['username'], time()+60*60*24*14, '/cinema/', 'www.burninginfo.com', NULL, TRUE); setcookie('password', md5($_POST['password']), time()+60*60*24*14, '/cinema/', 'www.burninginfo.com', NULL, TRUE); } else { setcookie('username', $_POST['username'], false, '/cinema/', 'www.burninginfo.com', NULL, TRUE); setcookie('password', md5($_POST['password']), false, '/cinema/', 'www.burninginfo.com', NULL, TRUE); } header("location: ../index.php"); exit(); }else { header("location: ../login-failed.php"); exit(); } }else { die("Query failed"); } ?> Link to comment https://forums.phpfreaks.com/topic/165313-solved-header-error/ Share on other sites More sharing options...
Philip Posted July 9, 2009 Share Posted July 9, 2009 http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Link to comment https://forums.phpfreaks.com/topic/165313-solved-header-error/#findComment-871808 Share on other sites More sharing options...
PFMaBiSmAd Posted July 9, 2009 Share Posted July 9, 2009 And the error message states where the output is being sent at, that is causing the header problem. Read the error message and stop the output that is being sent. Link to comment https://forums.phpfreaks.com/topic/165313-solved-header-error/#findComment-871910 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.