Adds phonenumber lookup to API, refactoring
This commit is contained in:
1 parent
d7979a3691
commit
ac7d136948
7 files changed
+149
-103
No files matched your search
+2
-22
@@ -1,32 +1,12 @@
|
||||
<?php
|
||||
set_include_path("../includes/");
|
||||
require_once("../inside/credentials.php");
|
||||
require_once("api_functions.php");
|
||||
require_once("../includes/DB.php");
|
||||
|
||||
/* Functions */
|
||||
|
||||
/* Set HTTP response code */
|
||||
function set_response_code($code) {
|
||||
if(!is_int($code)) {
|
||||
return false;
|
||||
}
|
||||
header('X-Ignore-This: something', true, $code);
|
||||
}
|
||||
|
||||
header('Access-Control-Allow-Origin: *', true); // Come fetch!
|
||||
|
||||
/* Connect to database */
|
||||
$options = array(
|
||||
'debug' => 2,
|
||||
'portability' => DB_PORTABILITY_ALL,
|
||||
);
|
||||
|
||||
$conn = DB::connect(getDSN(), $options);
|
||||
|
||||
if(DB :: isError($conn)) {
|
||||
echo $conn->toString();
|
||||
}
|
||||
$conn->setFetchMode(DB_FETCHMODE_ORDERED);
|
||||
$conn = get_db_connection(DB_FETCHMODE_ORDERED);
|
||||
|
||||
/* Validate params */
|
||||
if(!isset($_GET['q'])) {
|
||||
|
||||
Reference in new issue
Block a user