title: Trying to do a very basic login page using CSHTML but I can't get my if statement to work correctly
body: <pre><code>@{
  
      Page.Title = "Log in";
  
      // Generate page variables
      var db = Database.Open("calcinema");
      var email = "";
      var password = "";
      var getAcc = db.Query("SELECT * FROM Account;");
  
      if (IsPost &amp;&amp; Validation.IsValid()) {
          email = @Request.Form["email"];
          password = @Request.Form["password"];}
  
          foreach (var a in getAcc) {
  
              if (email == a.Email &amp;&amp; password == a.Password){
                   Response.Redirect("~/Browse.cshtml");}
       }            
  }
  
      &lt;head&gt;
          &lt;meta charset="utf-8" /&gt;
          &lt;title&gt;&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  &lt;table border="0" align="center"&gt;
      &lt;tr&gt;
      &lt;td&gt;
          &lt;form name="login" action="" method="get" accept-charset="utf-8"&gt;  
          &lt;label for="email"&gt;Email&lt;/label&gt;  
          &lt;input type="email" name="email" placeholder="yourname@email.com" required value = "@Request.Form["email"]"&gt; 
          &lt;label for="password"&gt;Password&lt;/label&gt;  
          &lt;input type="password" name="password" placeholder="Password" required value = "@Request.Form["password"]"&gt;  
          &lt;input type="submit" value="Login"&gt; 
          &lt;/form&gt;  
      &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The page loads but nothing happens regardless of whether or not the email and password is valid. It just takes the input and then returns me to the login page with the text fields empty as opposed to redirecting me to the Browse.cshtml page. </p>