title: How to get the success message after clicking on submit button
body: <p>I have my code where it should show a success message after submitting (click on add) but for some reason this success message is showing all the time even if I don't add anything, it is just showing on the top of the page.the problem is if I removed the message that is below if statement, the message will not show. the action is working fine it is just the success message. Can you please see what is the problem?</p>
  
  <p>Add.php</p>
  
  <pre><code>&lt;?php
  include('header.php');
  ?&gt;
  &lt;link rel="stylesheet" href="../../validation/dist/css/bootstrapValidator.css"/&gt;
  
  &lt;script type="text/javascript" src="../../validation/dist/js/bootstrapValidator.js"&gt;&lt;/script&gt;
    &lt;!-- =============================================== --&gt;
    &lt;?php
      include('../../form.php');
      $frm=new formBuilder;
    ?&gt;
    &lt;!-- =============================================== --&gt;
  
    &lt;!-- Content Wrapper. Contains page content --&gt;
    &lt;div class="content-wrapper"&gt;
      &lt;!-- Content Header (Page header) --&gt;
      &lt;section class="content-header"&gt;
        &lt;h1&gt;
          Add Coming Soon Movie
        &lt;/h1&gt;
        &lt;?php
        if(isset($_SESSION['add']))
        {?&gt;
        &lt;div class="alert alert-success"&gt;
    &lt;strong&gt;Success!&lt;/strong&gt; News added successfully..
  &lt;/div&gt;
  &lt;?php
  }?&gt;
        &lt;ol class="breadcrumb"&gt;
          &lt;li&gt;&lt;a href="index.php"&gt;&lt;i class="fa fa-home"&gt;&lt;/i&gt; Home&lt;/a&gt;&lt;/li&gt;
          &lt;li class="active"&gt;Add Coming Soon Movie&lt;/li&gt;
        &lt;/ol&gt;
      &lt;/section&gt;
  
      &lt;!-- Main content --&gt;
      &lt;section class="content"&gt;
  
        &lt;!-- Default box --&gt;
        &lt;div class="box"&gt;
          &lt;div class="box-body"&gt;
              &lt;form action="process_add_news.php" method="post" enctype="multipart/form-data" id="form1"&gt;
                &lt;div class="form-group"&gt;
                  &lt;label class="control-label"&gt;Movie name&lt;/label&gt;
                  &lt;input type="text" name="name" class="form-control"/&gt;
                  &lt;?php $frm-&gt;validate("name",array("required","label"=&gt;"Movie Name")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                   &lt;label class="control-label"&gt;Type&lt;/label&gt;
                  &lt;input type="text" name="type" class="form-control"&gt;
                  &lt;?php $frm-&gt;validate("type",array("required","label"=&gt;"Type","regexp"=&gt;"text")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;label class="control-label"&gt;Release Date&lt;/label&gt;
                  &lt;input type="date" name="date" class="form-control"/&gt;
                  &lt;?php $frm-&gt;validate("date",array("required","label"=&gt;"Release Date")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
  
                &lt;div class="form-group"&gt;
                  &lt;label class="control-label"&gt;Description&lt;/label&gt;
                   &lt;input type="text" name="description" class="form-control"&gt;
                   &lt;?php $frm-&gt;validate("description",array("required","label"=&gt;"Description")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                    &lt;label class="control-label"&gt;Images&lt;/label&gt;
                &lt;input type="file"  name="attachment" class="form-control" placeholder="Images"&gt;
                 &lt;?php $frm-&gt;validate("attachment",array("required","label"=&gt;"Image")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                  &lt;label class="control-label"&gt;Trailer Youtube Link&lt;/label&gt;
                  &lt;input type="text" name="video" class="form-control"/&gt;
                  &lt;?php $frm-&gt;validate("video",array("label"=&gt;"Image","max"=&gt;"500")); // Validating form using form builder written in form.php ?&gt;
                &lt;/div&gt;
                &lt;div class="form-group"&gt;
                  &lt;button class="btn btn-success"&gt;Add Movie&lt;/button&gt;
                &lt;/div&gt;
          &lt;/form&gt;
          &lt;/div&gt;
          &lt;!-- /.box-footer--&gt;
        &lt;/div&gt;
        &lt;!-- /.box --&gt;
  
      &lt;/section&gt;
      &lt;!-- /.content --&gt;
    &lt;/div&gt;
    &lt;?php
  include('footer.php');
  ?&gt;
  &lt;script&gt;
          &lt;?php $frm-&gt;applyvalidations("form1");?&gt;
      &lt;/script&gt;
  </code></pre>
  
  <p><strong>processToAdd.php</strong>:</p>
  
  <pre><code>&lt;?php
      include('../../config.php');
      extract($_POST);
         $uploaddir = '../Coming-soon/';
        $uploadfile = $uploaddir . basename($_FILES['attachment']['name']);
      move_uploaded_file($_FILES['attachment']['tmp_name'],$uploadfile);
      $flname="Coming-soon/".basename($_FILES["attachment"]["name"]);
      mysqli_query($con,"INSERT INTO tbl_news values (NULL,'$name','$type','$date','$description','$flname','$video')");
      $_SESSION['add']=1;
      header('location:add_movie_news.php');
  ?&gt;
  </code></pre>