I have one big problem:
I've been working on a project and always gives me this error:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\output\index.php:60) in C:\xampp\htdocs\output\Login.php on line 40
I tried everything, but it does not work... I tried remove html and when I remove all html and remain only form to submit data then already works...
On line 60 in index.php have only <?php
...
On line 40 in Login.php have header('Location: profile.php');
This is index.php file:
<?php
session_start();
error_reporting(E_ERROR | E_WARNING | E_PARSE);
require './Login.php';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="bg-BG" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#" itemscope itemtype="http://schema.org/Article">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="lightbox_bg" id="lightbox_bg" style="display: none;"></div>
<div class="box_bg1">
<div class="lightbox_registration lightbox" style="display:none">
<a href="#" class="lightbox_close"></a>
<h1>text </h1>
<p>text </p>
</div>
<div id="site">
<a href="index.php" class="logo"></a>
<ul class="topMenu">
<li><a class=" " href="materialy/materialy.html">text</a></li>
<li><a class=" " href="prirucka/index.php">text</a></li>
<li><a class=" showLightbox topRegistrace" rel=".lightbox_registration" href="#">Register</a></li>
</ul>
<div class="clearboth"></div>
<form action="" method="post" id="frm-loginEmailForm">
<div class="clearboth"></div>
<div class="toplista">
<div class="label"><label for="frmloginEmailForm-email">e-mail </label>:</div>
<input type="text" class="textwhite" name="email" id="frmloginEmailForm-email" required="required" data-nette-rules="{op:':filled',msg:"\u041c\u043e\u043b\u044f, \u0432\u044a\u0432\u0435\u0434\u0435\u0442\u0435 e-mail \u0430\u0434\u0440\u0435\u0441\u044a\u0442, \u043a\u043e\u0439\u0442\u043e \u0441\u0442\u0435 \u043f\u043e\u0441\u043e\u0447\u0438\u043b\u0438 \u043f\u0440\u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f\u0442\u0430. "},{op:':email',msg:"\u041c\u043e\u043b\u044f, \u0432\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u0432\u0430\u043b\u0438\u0434\u0435\u043d \u0435-mail \u0430\u0434\u0440\u0435\u0441. "}" value="" />
<div class="label"><label for="frmloginEmailForm-password">Pass</label>:</div>
<input type="password" class="textwhite" name="password" id="frmloginEmailForm-password" required="required" data-nette-rules="{op:':filled',msg:"\u041c\u043e\u043b\u044f, \u0432\u044a\u0432\u0435\u0434\u0435\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u0430. "},{op:':minLength',msg:"\u0412\u044a\u0432\u0435\u043b\u0438 \u0441\u0442\u0435 \u0442\u0432\u044a\u0440\u0434\u0435 \u043a\u0440\u0430\u0442\u043a\u0430 \u043f\u0430\u0440\u043e\u043b\u0430. ",arg:2}" />
<input type="hidden" name="login" value="1">
<input type="submit" class="blackbutton" name="odeslat" id="frmloginEmailForm-odeslat" value="Login" />
</div>
</form>
<div id="hlasky" class="hide">text </div>
<div id="obsah">
<div class="lightbox lightbox_medialni" style="display:none">
<a href="#" class="lightbox_close"></a>
<h1>text</h1>
<div>
</div>
<div class="clearleft"></div>
</div>
<div class="lightbox lightbox_dalsi" style="display:none">
<a href="#" class="lightbox_close"></a>
<h1>text</h1>
<div>
</div>
<div class="clearleft"></div>
</div>
<div class="box_content">
</div>
</div>
</div>
</div>
<?php
if (isset($_POST['login']) && $_POST['login'] == 1) {
Login::LoginUser($_POST['email'], $_POST['password']);
}
?>
</body>
</html>