title: What am I doing wrong? (PHP/HTML submit button)
body: <p>HTML:</p>
  
  <pre><code>&lt;form action="?" method = "post" &gt;
  &lt;button type="submit" class="btn btn-default btn-lg" name = "submit" value = 'Submit' &gt;Register&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code> &lt;?php
  
      if(isset($_POST['submit'])){
  
  
      echo '&lt;script language="javascript"&gt;';
      echo 'alert("message successfully sent")';
      echo '&lt;/script&gt;';
      }
      ?&gt;
  </code></pre>
  
  <p>The alerts don't come out when I click the button. The PHP does run if they're not enclosed within the 'if' statement.</p>