i'm a newbie in php and maybe my question is so silly.
i tried to create a session in a file named login.php
<?php
include "koneksi.inc.php";
$name=$_POST['name'];
$password=$_POST['password'];
$hasil=mysql_query("SELECT * FROM TabelPegawai WHERE nama='$name' AND password='$password'");
$row=mysql_fetch_array($hasil);
if ($row[nama]==$name AND $row[password]==$password)
{
session_start();
$_SESSION['namauser']=$row[nama];
$_SESSION['passuser']=$row[password];
$_SESSION['level']=$row[jabatan];
if($_SESSION['level']=="Manager")
{header("location: manager.php");}
else if($_SESSION['level']=="Kasir")
{header("location:kasir.php");}
else if($_SESSION['level']=="Gudang")
{header("location:gudang.php");}
else
{header("location:http://www.google.com");}
}
else
{header("location:http://www.yahoo.com");}
?>
but, $_SESSION is not recognized in other files like manager.php, gudang.php, and kasir.php
is there something wrong with my code?
thanks for your helps.