You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
534 B

<?php
include 'model.php';
$theDBA = new DatabaseAdapter();
if (isset($_GET))
if (isset($_GET[ "getQuote" ]) && $_GET[ "getQuote" ] === "true")
echo json_encode ($theDBA->getAllQuotations());
elseif (isset($_POST)) {
// Register/login user
if (isset( $_POST[ "userName" ] ) && isset( $_POST[ "password" ] ) )
echo "";
// Adding quote
if (isset( $_POST[ "addQuote" ] ) && isset( $_POST[ "author" ] ) ) {
$theDBA->addQuote($_POST[ "addQuote" ], $_POST[ "author" ]);
}
}