<?php
    header('Access-Control-Allow-Origin:*');
    header('Content-Type; application/json; charset=utf-8');
    header('Access-control-Allow-Method: POST');
    header('Access-control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-request-With');
    include('db.php');
        $inputdata = json_decode(file_get_contents("php://input"), true);
        $email = $inputdata['email'];
        $pub=$db->prepare('SELECT * FROM user WHERE email=?');

        $pub->execute(array($email));
        $data = $pub->fetchAll();    
        echo(json_encode(['data' => $data]));