header("public_html/index.php"); не кидает на другой файл.Ошибка вылазит: Cannot modify header information - headers already sent by вот
Вот код:
<!DOCTYPE html>
<html>
<head>
<title>Letters</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
if(isset($_POST["login"]) && isset($_POST["pass"])){
$fd = fopen("nick.txt", 'r');
while(!feof($fd))
{
$str = htmlentities(fgets($fd));
if($str == $_POST["login"]){
break;
}
}
fclose($fd);
$fd = fopen("passwords.txt", 'r');
while(!feof($fd))
{
$str = htmlentities(fgets($fd));
if($str == $_POST["pass"]){
header("public_html/index.php");
}
}
fclose($fd);
}
?>
<div id = "background">
<div id = "registration">
<form method="POST">
<p align="center" id = "text1">Login in.</p>
<p><input id = "input1" name="login" placeholder="Nickname"></p>
<p><input id = "input2" name="pass" type="password" placeholder="Password"></p>
<input id = "input3" type="submit" value="Login in." >
</form>
<p align = "center" id = "text2">No account? <a id = "a1" href="index.php">Register.</a><p>
</div>
</div>
</body>
</html>