title: I can't pass a variable through the include statement
body: <p>I'm just starting with PHP and I'm doing a sign-up form that passes the information to the register.php file and then the script in that file checks if the password field value equals the confirm password field value field then if they aren't equal, it sets a certain value to the $message variable and then redirects to the index.php file and where that $messege variable should be echoed in a p tag but isn't printed then</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;h1&gt;Sign Up&lt;/h1&gt;
    &lt;p&gt;
      It's free and only takes a minute!
    &lt;/p&gt;
    &lt;div&gt;
      &lt;p class="error"&gt;
        &lt;!--here is the $messege variable --&gt;
        &lt;?php
            include 'register.php';
            echo $messege;
            ?&gt;
      &lt;/p&gt;
    &lt;/div&gt;
    &lt;form class="form" action="register.php" method="post"&gt;
      &lt;label&gt;First Name:&lt;/label&gt;
      &lt;input type="text" name="first_name"&gt;&lt;br&gt;
      &lt;label&gt;Last Name:&lt;/label&gt;
      &lt;input type="text" name="last_name"&gt;&lt;br&gt;
      &lt;label&gt;Email:&lt;/label&gt;
      &lt;input type="email" name="email"&gt;&lt;br&gt;
      &lt;label&gt;Password:&lt;/label&gt;
      &lt;input type="password" name="password"&gt;&lt;br&gt;
      &lt;label&gt;Confirm Password:&lt;/label&gt;
      &lt;input type="password" name="confirm_password"&gt;&lt;br&gt;
      &lt;input type="submit" name="submit" value="Sign Up!"&gt;&lt;br&gt;
      &lt;input type="checkbox" name="terms"&gt;
      &lt;span&gt;By clicking the sign up button you
                  agree to our &lt;a href="terms.html"&gt;Terms &amp; Conditions&lt;/a&gt; and &lt;a href="terms.html"&gt;Privacy policy&lt;/a&gt; &lt;/span&gt;
    &lt;/form&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>and this the register.php file</p>
  <pre><code>&lt;?php
  
  if (isset($_POST['submit'])) {
    $first_name = $_POST['first_name'];
    $last_name  = $_POST['last_name'];
    $from_email = $_POST['email'];
    $password = $_POST['password'];
    $confirm_password = $_POST['confirm_password'];
    if ($password == $confirm_password) {
      $messege = null;
        header(&quot;Location: index.php?Succesful&quot;);
    } else {
      $messege = &quot;Password and Confirm-Password doesn't match&quot;;
      header(&quot;Location: index.php?error-in-password&quot;);
    }
  
  }
  
  ?&gt;
  </code></pre>