YaWK  24.1
Yet another WebKit
check-emailBooking.php
Go to the documentation of this file.
1 <?php
2 /* check if email is already registered */
3 if (!empty($_POST['email']))
4 {
5  include '../../../classes/db.php';
6  $db = new \YAWK\db();
7  $request = $db->quote($_POST['email']);
8  $bookingTable = mysqli_query($db, "SELECT email FROM {plugin_booking} WHERE email = '".$request."' AND success = '1'");
9  $userTable = mysqli_query($db, "SELECT email FROM {users] WHERE email = '".$request."'");
10  $res = mysqli_fetch_row($bookingTable);
11  if($res[0])
12  {
13  $res2 = mysqli_fetch_row($userTable);
14  if (!$res2[0])
15  { // email not in use yet
16  echo "true"; die;
17  }
18  else
19  { // email in use
20  echo "false"; die;
21  }
22  }
23  else
24  { // email adress is not a valid booking success entry
25  echo "false"; die;
26  }
27 }
28 else
29 { // get var is invalid
30  echo "false";
31 }
die
Definition: block-user.php:27