title: Reloading a page resubmits form (PHP)
body: <p>So when I fill in a form, and I submit the form, if I reload the page, it resubmits the form. Here is my code:</p>
  
  <p>Top of the page:</p>
  
  <pre><code>    include_once "connect.php";
  
          $kickErrorMessage = "Please fill in all the fields.";
          $banErrorMessage = "Please fill in all the fields.";
  
  
  
  if(isset($_SESSION['user_id']) &amp;&amp; isset($_SESSION['email']) &amp;&amp;           isset($_SESSION['password']) &amp;&amp; isset($_SESSION['rank'])) {
              if(isset($_POST['banUsername']) &amp;&amp; isset($_POST['banReason']) &amp;&amp; isset($_POST['banEvidence']) &amp;&amp; isset($_POST['banDuration']) &amp;&amp; isset($_POST['banSubmit'])) {
  
                  $email = $_SESSION['email'];
                  $punisherId = $_SESSION['user_id'];
  
                  $username = $mysqli-&gt;real_escape_string($_POST['banUsername']);
                  $reason = $mysqli-&gt;real_escape_string($_POST['banReason']);
                  $evidence = $mysqli-&gt;real_escape_string($_POST['banEvidence']);
  
                  //Etc...
  </code></pre>
  
  <p>I've also tried to unset the values at the end of the code but that doesn't seem to work either. I've also tried the array_key_set (Or whatever it's called) instead of isset, but that doesn't seem to work either.</p>
  
  <pre><code>            unset($_POST['banSubmit']);
              unset($_POST['banUsername']);
              unset($_POST['banReason']);
              unset($_POST['banEvidence']);
              unset($_POST['banDuration']);
  </code></pre>
  
  <p>Here is my form in HTML which is on the same page as my PHP code. I just can't understand why it's not working.</p>
  
  <pre><code>&lt;form style="width: 80%;" id="banPlayer" method="post"&gt;
  &lt;p id="error"&gt;&lt;?php echo $banErrorMessage; ?&gt;&lt;/p&gt;
                  Username: &lt;input type="text" name="banUsername"&gt;&lt;br&gt;
                  Reason: &lt;textarea name="banReason"&gt;&lt;/textarea&gt;&lt;br&gt;
                  Evidence: &lt;input type="text" name="banEvidence"&gt;&lt;br&gt;
  
                  Duration: &lt;select name="banDuration" style="margin-bottom: 30px;"&gt;
                      &lt;option value="oneDay"&gt;1 Day&lt;/option&gt;
                      &lt;option value="twoDay"&gt;2 Days&lt;/option&gt;
                      &lt;option value="threeDay"&gt;3 Days&lt;/option&gt;
                      &lt;option value="fourDay"&gt;4 Days&lt;/option&gt;
                      &lt;option value="fiveDay"&gt;5 Days&lt;/option&gt;
                      &lt;option value="sixDay"&gt;6 Days&lt;/option&gt;
                      &lt;option value="oneWeek"&gt;1 Week&lt;/option&gt;
                      &lt;option value="twoWeek"&gt;2 Weeks&lt;/option&gt;
                      &lt;option value="threeWeek"&gt;3 Weeks&lt;/option&gt;
                      &lt;option value="oneMonth"&gt;1 Month&lt;/option&gt;
                      &lt;option value="twoMonth"&gt;2 Months&lt;/option&gt;
                      &lt;option value="threeMonth"&gt;3 Months&lt;/option&gt;
                      &lt;option value="fourMonth"&gt;4 Months&lt;/option&gt;
                      &lt;option value="fiveMonth"&gt;5 Months&lt;/option&gt;
                      &lt;option value="sixMonth"&gt;6 Months&lt;/option&gt;
                      &lt;option value="sevenMonth"&gt;7 Months&lt;/option&gt;
                      &lt;option value="eightMonth"&gt;8 Months&lt;/option&gt;
                      &lt;option value="nineMonth"&gt;9 Months&lt;/option&gt;
                      &lt;option value="tenMonth"&gt;10 Months&lt;/option&gt;
                      &lt;option value="elevenMonth"&gt;11 Months&lt;/option&gt;
                      &lt;option value="oneYear"&gt;1 year&lt;/option&gt;
                      &lt;option value="permanent"&gt;Permanent&lt;/option&gt;
                  &lt;/select&gt;
  
  
  
  &lt;span style="margin-left: 4%; margin-top: 60px;"&gt;
                  &lt;a class="button" onClick="showPunishmentWarning();" href="#"&gt;Terms and conditions&lt;/a&gt;
                  &lt;a class="button" onClick="showHelpScreen();" href="#"&gt;Help! I incorrectly punished someone!&lt;/a&gt;
              &lt;/span&gt;
  
              &lt;input style="margin-top: -8px;" type="submit" value="Ban Player" name="banSubmit"&gt;
  
  
          &lt;/form&gt;
  </code></pre>
  
  <p>I'm hoping someone else can spot my error. I have no idea what's happening here.</p>