CANT ACCESS SESSION VARIABLES OUTSIDE SUBMIT BUTTON CODE : Hello Everyone I am a beginner in php.Ihave a problem in accessing session variables outside the code for submit button.when i am printing the session variable within submit code it is printing but at the time of echoing outside submit code it is not printing the value of date .Actually i want to insert the value of session variable in database but it is not getting inserted .the code is given below:

      <!Doctype html>
      <?php
     session_start();
     $_SESSION['date']='';
     include 'connect.php';
     ?>
     <form>
     Date: <input type='date' name='date'> <br>
     <input type='submit' name='submit'>
     </form>
     <?php
     $date='';
     if(isset($_POST['submit'] ))
     {
     $date=$_POST['date'];
     $_SESSION['bdate']=$date;
     echo $_SESSION['bdate'];
     }
     ?>

    <?php
    echo $_SESSION['date'];
    ?>
    Any help will be greatly appreciated.
    Thanks ,
    Nilanjana Maiti.
