So i'm trying to make a little admin page for my site to manage this and that,but its always giving me warnings like:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/phisiomins/web/rendszergazda/index.php:1) in /home/phisiomins/web/rendszergazda/index.php on line 2
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/phisiomins/web/rendszergazda/index.php:1) in /home/phisiomins/web/rendszergazda/index.php on line 2
and when i try to log into then it gives 3:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/phisiomins/web/rendszergazda/belepellenor.php:1) in /home/phisiomins/web/rendszergazda/belepellenor.php on line 2
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/phisiomins/web/rendszergazda/belepellenor.php:1) in /home/phisiomins/web/rendszergazda/belepellenor.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /home/phisiomins/web/rendszergazda/belepellenor.php:1) in /home/phisiomins/web/rendszergazda/belepellenor.php on line 9
so here is the 2 php im talkin about,i'Ve read about this warning but can't find the mistake,the index.php:
<?php
session_start();
include "../connect.php";
if(!isset($_SESSION["admin"]))
{
?>
<div>
<form action="belepellenor.php" method="post">
Felhasználónév:<br><input type="text" name="felhasznalonev"><br>
Jelszó:<br><input type="password" name="jelszo"><br>
<input type="submit" value="Belépés">
</form>
<div>
<?php
}
else include "adminfelulet.php";
?>
and the belepellenor.php:
<?php
session_start();
include("../kapcsolat.php");
$vissza=mysqli_query($db, "select * from felhasznalok where felhasznalonev='".$_POST["felhasznalonev"]."' and jelszo='".$_POST["jelszo"]."'");
$sorok_szama=mysqli_num_rows($vissza);
if($sorok_szama>0)
{
$_SESSION["admin"]=$_POST["felhasznalonev"];
header("Location:index.php");
}
else print "Hibás felhasználónév vagy jelszó!<br><a href='http://www.testfogyasztas.net/rendszergazda/index.php'>Vissza</a>";
?>
any ideas?