title: PHP Login System without MySQL
body: <p>So, I'm trying to set up a login script without the usage of MySQL because I don't have any experience with it at all I need to wait one year until I can sign up for a course at our school.</p>
  
  <p>My thoughts of approaching this:</p>
  
  <p>The user needs to login with a username and a invitation key. I'd like to have a .txt (I know that's insecure as hell but whatever) where both the username and invitation key of an accepted person are stored. The PHP scripts compares the sent credentials with the ones stored in the .txt. If it matches, you're logged in, if not, then it gets aborted.</p>
  
  <p>So, how can I read data from a .txt and how could I format the .txt so my script can differ between username and invitation key?</p>
  
  <p>Here's what I've got so far:</p>
  
  <pre><code>if(isset($_POST['auth']) &amp;&amp; $_SERVER['REQUEST_METHOD'] == 'POST'){
  
      session_start();
  
      $usr=$_POST['user'];
      $invkey=$_POST['key'];
  
      function authenticate($usr, $invkey){
  
      }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>PS: I know this would be very insecure, so if you're bored you could give me tips how I could secure it. :)</p>