Jump to content

[SOLVED] Header Error.


daveoffy

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.