Ejemplo n.º 1
0
<!DOCTYPE html>
<html lang="en">
<head>
</head>

<body>

  <div class="page-content">


    <?php 
require_once 'dbinterface.php';
$db_handle = new dbinterface\PDO_handle();
$db_handle->set_target("store-cakes");
$products = $db_handle->pull("2 3");
print_r($products);
$db_handle = null;
?>


  </div>
</body>
</html>
Ejemplo n.º 2
0
<?php

header('Content-Type: application/json');
header('Cache-Control: no-cache, must-revalidate');
require_once 'dbinterface.php';
$unsafe_un = isset($_POST['u_n']) ? $_POST['u_n'] : false;
$result = ['valid' => "false"];
if ($unsafe_un) {
    $db_handle = new dbinterface\PDO_handle();
    $record = $db_handle->pull("1 2 3", ['Username' => "{$unsafe_un}"], $exists);
    if (!empty($record)) {
        $result = ['valid' => "true", 'fname' => $record[0]['FirstName'], 'lname' => $record[0]['LastName']];
        $record = null;
        $db_handle = null;
    }
}
echo json_encode($result);