Thanks alot! The second one works fine, i encased redirect in the following function:
function redirect($page){
if($_SERVER['HTTP_REFERER'] != ''){
header('Location: '.$_SERVER['HTTP_REFERER']);
}
else{
header ("Location: $page");
}
}
So that i can pass a default page if HTTP_REFERER doesn't work..
Thanks again!