title: How to create a session Login
body: <p>i'm trying to create a login session from an html form that send data to a mysql db, check for credentials and start a session for each pages that the user will visit.</p>
  
  <p>The problem is that i've seen just </p>
  
  <pre><code>&lt;?php
  session_start();
  if (!isset($_SESSION["login"]) || $_SESSION["login"] == "")
  header("");
  else
  header("Location:login.php");
  ?&gt; 
  
  &lt;html&gt;
  &lt;body&gt;
  ...
  &lt;\body&gt;
  &lt;\html&gt;
  </code></pre>
  
  <p>but i don't like to have php code together with html. Actually i have a folder with all php files, is there a way to have a login in this way?</p>