aboutsummaryrefslogtreecommitdiff
blob: 826c38c5ac569aaf3c4bc493073f8ec57912f422 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
   class MyDB extends SQLite3 {
      function __construct() {
         $this->open('users.db');
      }
   }

   if(isset($_POST['email'], $_POST['pass']))
   {
	$email = $_POST['email'];
	$pass = $_POST['pass'];

	$db = new MyDB();

	$sql = 'SELECT * FROM Users WHERE email=\''.$email.'\' AND password=\''.$pass.'\'';

	$ret = $db->query($sql);
	while($row = $ret->fetchArray(SQLITE3_ASSOC)) {
		echo 'Logged in as '.$row['email'].'<br>';
	}
	$db->close();
   }
?>