I am trying to pass a variable from one page to another using a URL but I get a NOTICE. I have read that NOTICE or WARNINGS can be suppressed, by I want to learn how to fix this if possible. Thanks!
Notice: Undefined index: status in /view_dept.php on line 139
this is the URL and where the query happens - (technically the page1 - where the variable comes from):
header('location:view_dept.php?status=success');
This is the "page2", where I need to pass the variable so I can echo a success message. This is the MAIN PAGE.
<?php
    if( $_GET['status'] == 'success'):
        echo 'SUCCESS';
    endif;
?>
 
    