I am having error in proseslogin.php
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/proseslogin.php:3) in /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/proseslogin.php on line 6
Di sini blok aplikasi setelah login dilakukan
Anda berhasil menjalankan!
Warning: Cannot modify header information - headers already sent by (output started at /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/proseslogin.php:3) in /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/proseslogin.php on line 36
proseslogin.php
<?php
// start session
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$login = isset($_POST['login']) ? $_POST['login'] : false;
//function
function periksa ($username, $password){
if (($username=="*****") and ($password=="*******")){
return true;
}else{
return false;
}
}
// cek
if (periksa($username, $password)) {
$login=true;
}
else {
echo "User ID atau password salah!";
header("Location: http://localhost/Masterlink/cgoods/index.php");
}
if ($login) {
echo "<br>Di sini blok aplikasi setelah login dilakukan";
echo "<br>Anda berhasil menjalankan!";
// buat session username
$_SESSION['username'] = $username;
header("Location: http://localhost/Masterlink/cgoods/admin.php");
exit();
}
?>
line 6: session_start();
The error appears after I enter my username and password.