Een vriend van me heeft voor me een script gemaakt, maar er zit een foutje in met de headers die voor de login cookie zorgen.

De fouten zijn:

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/fh2028/domains/tdkclan.com/public_html/sites/Clantemp1/calender/login.php:9) in /usr/home/fh2028/domains/tdkclan.com/public_html/sites/Clantemp1/calender/login.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/fh2028/domains/tdkclan.com/public_html/sites/Clantemp1/calender/login.php:9) in /usr/home/fh2028/domains/tdkclan.com/public_html/sites/Clantemp1/calender/login.php on line 26
Successful Login.

De code staat hier onder:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<?PHP
include('functions.php'); // This includes the database functions i made for the database.

$username = $_POST['Username']; // Get the username sent from the form.
$password = $_POST['Password']; // Get the password sent from the form.
$md5_password = md5($password); // MD5 Hash the password, for extra security.
$page_rank = 1; // The rank of this page. Using 1 as admin, but you can change this as long as you change the 
                // database to reflect the change.

Connect(); // Connect to the database.

$sql = "SELECT rank FROM users WHERE username = '$username' AND password = '$md5_password' AND rank = '$page_rank' LIMIT 0,1";
$query = mysql_query($sql);

if(mysql_num_rows($query) == 1){
	$row = mysql_fetch_row($query);
	setcookie('AdmUsername', $username, time()+60*60*24*30, '/', '', 0);
	setcookie('AdmRank', $row[0], time()+60*60*24*30, '/', '', 0);
	echo('<strong>Successful Login.</strong><br />'.chr(10));
} else {
	echo('<strong>Login Failed.</strong><br />'.chr(10));
}

Disconnect(); // Disconnect from the database.
?>
</body>
</html>



Mvg Jens
Er zit maar 1 echo statement in dat bestand, dus waarschijnlijk gaat het daar fout.
die echo aan disconnect wegdoen?

EDIT:
'k Heb de echo weggehaald, en ze zegt nog steeds hetzelfde
Probeer dan die tip maar uit met ob_start enz die ik al eerder gaf.

Reageren