title: Run PHP script with HTML in same file
body: <p>I'm trying to create a simple PHP registration and login form.
  Prior to adding styling and HTML to the register.php file, all worked as expected.
  Now when Register is clicked, instead of saying thankyou for registering, nothing happens.</p>
  
  <pre><code>    &lt;html&gt;
  &lt;head&gt;
  &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="wrapper"&gt;
  &lt;div class="form"&gt;
  
  &lt;?php
  echo "&lt;h1&gt;Register&lt;/h1&gt;";
  
  $submit = $_POST['submit'];
  
  // form data
  
  $fullname = STRIP_TAGS($_POST['fullname']);
  $username = STRIP_TAGS($_POST['username']);
  $password = STRIP_TAGS($_POST['password']);
  $repeatpassword = STRIP_TAGS($_POST['repeatpassword']);
  $date = date("Y-m-d");
  
  if ($submit)
  {   
      if($fullname&amp;&amp;$username&amp;&amp;password&amp;&amp;$repeatpassword)
      {
  
  
      if ($password==$repeatpassword)
      {
          //check char length of username and fullname
          if(strlen($username)&gt;25||strlen($fullname)&gt;25)
          {
              echo "Length of username or fullname is too long!";
          }
          else
          {   //check password length
  
              if (strlen($password)&gt;25||strlen($password)&lt;6)
              {
              echo "Password must be between 6 and 25 characters";
              }
              else 
              {   //register the user!
                  // encrypt password
              $password = md5($password);
              $repeatpassword = md5($repeatpassword);
  
                  //open database
  
              $connect = mysql_connect("localhost", "Matt", "password123");
              mysql_select_db("phpsignin");
  
              $queryreg = mysql_query("
              INSERT INTO users VALUES ('','$fullname','$username','$password','$date')`
  
              ");
  
              die ("Thankyou for registering! &lt;a href='index.php'&gt; Return to login page&lt;/a&gt;");
              }
          }
  
  
      }   
      else
          echo "Your passwords do not match!";
      }
      else
          echo "Please fill in &lt;b&gt;all&lt;/b&gt; fields!";
  
  }
  
  ?&gt;
  &lt;form id="login" action='register.php' method='POST'&gt;
      &lt;fieldset&gt;
              &lt;ol&gt;
              &lt;li&gt;
              &lt;label&gt;Your Full Name:
              &lt;input type="text" name='fullname' value='&lt;?php echo $fullname; ?&gt;'&gt;
              &lt;/label&gt;
              &lt;/li&gt;
  
              &lt;li&gt;
              &lt;label&gt;Choose a username:
              &lt;input type="text" name='username' value='&lt;?php echo $username;?&gt;'&gt;
              &lt;/label&gt;
              &lt;/li&gt;
  
              &lt;li&gt;
              &lt;label&gt;Choose a password:
              &lt;input type="password" name='password'&gt;
              &lt;/label&gt;
              &lt;/li&gt;
  
              &lt;li&gt;
              &lt;label&gt;Confirm Your Password:
              &lt;input type="password" name='repeatpassword'&gt;
              &lt;/label&gt;
              &lt;/li&gt;
      &lt;/fieldset&gt;
      &lt;div id="buttonHolder"&gt;
      &lt;button type="submit" name="submit"&gt;Register&lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>