title: Create User Account -- php makes HTML form disappear
body: <p>I am working on building a PHP based Login/Create Account script. The form displays properly as long as the PHP at the top of the file is commented out/doesn't exist. As soon as I place the php in the file, the form disappears. Can anyone see if they find a reason as to why this is happening? </p>
  
  <p>Thanks,
  Matt   </p>
  
  <p>//edit 
  So I discovered that the error resides with the if/else statement for checking that passwords match. If I comment out the else statement, the page displays properly, as soon as it is commented out, I get a blank page. I even commented out the mysql_query() and just put in a simple echo, no luck.
      
  
  <pre><code>$db_found2 = conServer();
  
  if($db_found2) {
      if (!empty($_POST['username']) || !empty($_POST['password']) || !empty($_POST['email']) || !empty($_POST['conpassword'])) {
          $username = $_POST['username'];
          $password = $_POST['username'];
          $conpassword = $_POST['conpassword'];
          $email = $_POST['email'];
  
          if ($password != $conpassword) {
              $errormsg = "";
              $passerr = "Passwords do not match!";
  
          }
      }
  }
  
  function conServer() {
      $user_name = ""; //not displayed for privacy purposes
      $password = ""; //not displayed for privacy purposes
      $database = ""; //not displayed for privacy purposes
      $server = "localhost";
      $table = "users";
  
      $db_handle = mysql_connect($server, $user_name, $password);
      $db_found = mysql_select_db($database, $db_handle);
  
      return $db_found;
  }
  
  
  ?&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;link rel=stylesheet href="login.css" /&gt;
  &lt;/head&gt;
  
  &lt;body class="login"&gt;
      &lt;div id="login"&gt;
  
      &lt;form id="loginform" action="create.php" method="post"&gt;
      &lt;p&gt;
          &lt;label for="username"&gt;
          Username *
          &lt;br&gt;
          &lt;input type="text" name="username" id="username"/&gt;&lt;span class="error"&gt;&lt;?php echo $errormsg; ?&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/p&gt;
  
      &lt;p&gt;
          &lt;label for="password"&gt;
          Password *
          &lt;br&gt;
          &lt;input type="password" name="password" id="password"/&gt;&lt;span class="error"&gt;&lt;?php echo $errormsg; ?&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/p&gt;
  
      &lt;p&gt;
          &lt;label for="password"&gt;
          Confirm Password *
          &lt;br&gt;
          &lt;input type="password" name="conpassword" id="password"/&gt;&lt;span class="error"&gt;&lt;?php echo $errormsg; ?&gt;&lt;/span&gt;&lt;span class="error"&gt;&lt;?php echo $passerr; ?&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/p&gt;
  
      &lt;p&gt;
          &lt;label for="email"&gt;
          Email *
          &lt;br&gt;
          &lt;input type="text" name="email" id="email" /&gt;&lt;span class="error"&gt;&lt;?php echo $errormsg; ?&gt;&lt;/span&gt;
          &lt;/label&gt;
      &lt;/p&gt;
  
      &lt;input type="submit" id="submit" value="Go -&gt;"/&gt;
      &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>