Hi Lucky-8,
Are you turning on your register global ? if so, you better to turn it off cause it would make your web prone for hijacked. this also resolve your 'another doubt'.
--- try this ( hei ,you missed your closing ')' ) ---
session_start();
if(!isset($_SESSION['myusername'])){
header("location:main_login.php");
}
else {
if($_SESSION['myusername'] == 'admin'){
header("location:admin.php");
}else {
header("location:simple.php");
} }
to prevent user from changing the value directly on the url, then you must read the value by using POST method...