I dont know what mistakes I have made. could you help me, please?
login.php
<form action="admin.php" method="post"> <input type="text" name="username" id="username" /><br /> <input type="password" name="password" id="password" /><br /> <input type="submit" name="submit" value="Login" id="submit" /><br /> </form>
Check_login.php
<?php
$cms_username = "vakho";
$cms_password = "123";
$_POST['username'];
$_POST['password'];
if($username == "" || $password == "")
{
echo "INPUT IS NULL. PLASE ENTER USER AND PASSWORD";
exit();
}
if($username != $cms_username || $password != $cms_password)
{
echo "YOUR NAME OR PASSWORD IS NOT CORRECT";
exit();
}
if($username == $cms_username && $password == $cms_password)
{
session_start();
$_SESSION['cms_key'] = 'openSession';
header("Location:AdminPanel.php");
}
?>
adminpanel.php
<?php
session_start();
if ($_SESSION['cms_key'] == "openSession")
{
header("Location: Check_login.php");
}
else
{
exit();
}
?>
<body>
// where I'm going to Add, edit and information
</body>
ERRORS:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at F:\Program Files\VertrigoServ\www\admin\Check_login.php:11) in F:\Program Files\VertrigoServ\www\admin\Check_login.php on line 32 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at F:\Program Files\VertrigoServ\www\admin\Check_login.php:11) in F:\Program Files\VertrigoServ\www\admin\Check_login.php on line 32 Warning: Cannot modify header information - headers already sent by (output started at F:\Program Files\VertrigoServ\www\admin\Check_login.php:11) in F:\Program Files\VertrigoServ\www\admin\Check_login.php on line 34


Sign In
Create Account


Back to top









