function processForm() { $db = new DB_Functions(); $error_msg = ""; //validate user input if ($_POST['companyName'] == "") { printForm(); echo "Invalid Company Name.\n"; return; } else { if ($_POST['lastTradedPrice'] == "") { printForm(); echo "Invalid Last Traded Price Value.\n"; return; } else { if ($_POST['previousPrice'] == "") { printForm(); echo "Invalid Previous Price Value.\n"; return; } } } //save data to table $change = $_POST['lastTradedPrice'] - $_POST['previousPrice']; $result = $db->addShareListingEntry($_POST['companyName'], $_POST['lastTradedPrice'], $_POST['previousPrice'], $change); if (!$result == false) { //data was successfully saved to database header('Location: http://localhost/eserver/account.php'); } else { $error_msg = "Data could not be saved in database.\n"; printForm(); } }
/** * Sending Push Notification */ public function send_notification($title, $message) { // include config include_once './config.php'; include_once './db_functions.php'; $db = new DB_Functions(); $ids = $db->getRegisteredIds(); // Set POST variables $url = 'https://android.googleapis.com/gcm/send'; $fields = array('registration_ids' => $ids, 'notification' => array('title' => $title, 'body' => $message)); $headers = array('Authorization: key=' . GOOGLE_API_KEY, 'Content-Type: application/json'); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Disabling SSL Certificate support temporarly curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); // Execute post $result = curl_exec($ch); if ($result === FALSE) { die('Curl failed: ' . curl_error($ch)); } // Close connection curl_close($ch); echo $result; }
function getUltimoPacienteId() { require_once 'include/DB_Functions.php'; $db = new DB_Functions(); $id = $db->getUltimoPacienteInserido(); return $id; }
/** * Storing new user * returns user details */ public function storePatient($name, $email, $password, $address, $telephone) { require_once 'DB_Functions.php'; $dbFunctions = new DB_Functions(); $resultP = mysqli_query($this->mysqli, "INSERT INTO per_all_people_f(name, email, person_type, telephone ) VALUES('{$name}', '{$email}', 'P' , '{$telephone}');"); // check for successful store if ($resultP) { // get user details $personId = mysqli_insert_id($this->mysqli); // last inserted id $uuid = uniqid('', true); $hash = $dbFunctions->hashSSHA($password); $encrypted_password = $hash["encrypted"]; // encrypted password $salt = $hash["salt"]; // salt $resultU = mysqli_query($this->mysqli, "INSERT INTO users(unique_id, name, email, person_id, encrypted_password, salt, created_at) VALUES('{$uuid}', '{$name}', '{$email}', '{$personId}', '{$encrypted_password}', '{$salt}', NOW())"); $resultPatient = mysqli_query($this->mysqli, "INSERT INTO patient(person_id) VALUES('{$personId}')"); $patientId = mysqli_insert_id($this->mysqli); // last inserted id $patientIdUpdate = mysqli_query($this->mysqli, "update per_all_people_f set patient_id = {$patientId} where person_id = {$personId}"); $resultAddress = mysqli_query($this->mysqli, "INSERT INTO address(house_no,person_id) VALUES('{$address}','{$personId}')"); $result = mysqli_query($this->mysqli, "SELECT * FROM per_all_people_f WHERE person_id = {$personId}"); if ($resultU && $resultPatient && $resultAddress && $patientIdUpdate) { return mysqli_fetch_array($result); } else { return FALSE; } } else { return false; } }
function smartpush($uid, $message) { include "db_functions.php"; include "gcm.php"; $gcm = new GCM(); $db = new DB_Functions(); $users = $db->getAllUsers(); if ($users != false) { $no_of_users = mysql_num_rows($users); } else { $no_of_users = 0; } if ($no_of_users > 0) { while ($row = mysql_fetch_array($users)) { $regId = $row['gcm_regid']; // $message = "สวัสดีชาวโลก"; $registatoin_ids = array($regId); // $message = array("price" => $message); $result = $gcm->send_notification($registatoin_ids, $message); //echo $result; } } else { echo "ไม่มีข้อมูล"; } }
function processForm() { $db = new DB_Functions(); $error_msg = ""; //validate user input if ($_POST['currency'] == "") { printForm(); echo "Invalid Currency Entered.\n"; return; } else { if ($_POST['buyingRate'] == "") { printForm(); echo "Invalid Buying Rate.\n"; return; } else { if ($_POST['sellingRate'] == "") { printForm(); echo "Invalid Selling Rate.\n"; return; } } } //save data to table $result = $db->addExchangeRate($_POST['currency'], $_POST['buyingRate'], $_POST['sellingRate']); if (!$result == false) { //data was successfully saved to database header('Location: http://localhost/eserver/account.php'); } else { $error_msg = "Data could not be saved in database.\n"; printForm(); } }
public function testChangeBeliebt() { $db = new DB_Functions(); $this->assertTrue($db->changeBeliebt(1, 1)); $irgendneVariable = $db->getSpeisen(); $this->assertEquals(1, $irgendneVariable[0]['beliebt'], 'Beliebtheit nicht gestiegen'); }
function searchDB($query, $extra) { // Get Database connector include_once 'config/db_functions.php'; $db = new DB_Functions(); $result = $db->searchTable($query, $extra); //$result =$extra; return $result; }
/** * Sending Push Notification */ public function send_notification($registration_ids, $message) { // include config require_once 'config.php'; // Set POST variables $url = 'https://android.googleapis.com/gcm/send'; $fields = array('registration_ids' => $registration_ids, 'data' => $message); $headers = array('Authorization: key=' . GOOGLE_API_KEY, 'Content-Type: application/json'); // Open connection $ch = curl_init(); // Set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Disabling SSL Certificate support temporarly curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); // Execute post $result = curl_exec($ch); if ($result === FALSE) { die('Curl failed: ' . curl_error($ch)); } else { $jsonres = json_decode($result); if (!empty($jsonres->results)) { require_once 'db_functions.php'; $db = new DB_Functions(); for ($i = 0; $i < count($jsonres->results); $i++) { if (isset($jsonres->results[$i]->registration_id)) { $new = $db->updateUser($registration_ids[$i], $jsonres->results[$i]->registration_id); } else { if (isset($jsonres->results[$i]->error)) { if ($jsonres->results[$i]->error == "NotRegistered") { $res = $db->deleteUser($registration_ids[$i]); } } } } echo $result . "\n"; $canonical_ids_count = $jsonres->canonical_ids; if ($canonical_ids_count) { echo count($canonical_ids_count) . " registrations updated\n"; } } } // Close connection curl_close($ch); }
function processForm() { $db = new DB_Functions(); $error_msg = ""; //validate user input if ($_POST['ad'] == "") { printForm(); echo "Invalid Adert value.\n"; return; } else { if ($_POST['ad_url'] == "") { printForm(); echo "Invalid Advert URL value.\n"; return; } else { if ($_POST['ad_category'] == "") { printForm(); echo "Invalid Advert category value.\n"; return; } } } //save data to table $result = $db->addNewAdvert($_POST['ad'], $_POST['ad_url'], $_POST['ad_category']); if (!$result == false) { //data was successfully saved to database header('Location: http://localhost/eserver/account.php'); } else { $error_msg = "Data could not be saved in database.\n"; printForm(); } }
function reportList() { $db = new DB_Functions(); $reportNames = $db->getAllReportList(); if ($reportNames != false) { $no_of_reports = mysql_num_rows($reportNames); } else { $no_of_reports = 0; } echo '<li><a>NA</a></li>'; if ($no_of_reports > 0) { while ($row = mysql_fetch_array($reportNames)) { echo '<li><a >' . $row["ReportName"] . '</a></li>'; } } else { echo '<li>No Reports Added Yet!</li>'; } }
function usersList() { $db = new DB_Functions(); $users = $db->getAllUsers(); if ($users != false) { $no_of_users = mysql_num_rows($users); } else { $no_of_users = 0; } echo '<li><a>NA</a></li>'; if ($no_of_users > 0) { while ($row = mysql_fetch_array($users)) { echo '<li><a >' . $row["Name"] . '</a></li>'; } } else { echo '<li>No Users Registered Yet!</li>'; } }
function processForm() { $db = new DB_Functions(); //validate user input if ($_POST['rangeFrom'] == "") { printForm(); echo "Invalid From Range.\n"; return; } else { if ($_POST['rangeTo'] == "") { printForm(); echo "Invalid Invalid Range To.\n"; return; } else { if ($_POST['1MonthPa'] == "") { printForm(); echo "Invalid 1 month pa Value.\n"; return; } else { if ($_POST['3MonthPa'] == "") { printForm(); echo "Invalid 3 month pa Value.\n"; return; } else { if ($_POST['6MonthPa'] == "") { printForm(); echo "Invalid 6 month pa Value.\n"; return; } else { if ($_POST['1YearPa'] == "") { printForm(); echo "Invalid 1 Year pa Value.\n"; return; } } } } } } //save data to table $result = $db->addFixedDepositRate($_POST['rangeFrom'], $_POST['rangeTo'], $_POST['1MonthPa'], $_POST['3MonthPa'], $_POST['6MonthPa'], $_POST['1YearPa']); if (!$result == false) { //data was successfully saved to database header('Location: http://localhost/eserver/account.php'); } else { $error_msg = "Data could not be saved in database.\n"; printForm(); } }
function processForm() { $db = new DB_Functions(); $error_msg = ""; //validate user input if ($_POST['adminname'] == "") { printForm(); echo "Invalid Name.\n"; return; } else { if ($_POST['idNo'] == "") { printForm(); echo "Invalid IdNo.\n"; return; } else { if ($_POST['password'] == "") { printForm(); echo "Invalid Password.\n"; return; } else { if ($_POST['password'] != $_POST['passwordConfirm']) { printForm(); echo "Passwords do not match!\n"; return; } else { if ($_POST['username'] == "") { printForm(); echo "Invalid Username.\n"; return; } } } } } //save data to table $result = $db->administratorSignUp($_POST['username'], md5($_POST['password']), $_POST['idNo'], $_POST['adminname']); if (!$result == false) { //data was successfully saved to database header('Location: http://localhost/eserver/account.php'); } else { $error_msg = "Data could not be saved in database.\n"; printForm(); } }
<?php ini_set('default_charset', 'utf-8'); require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array $response = array("error" => FALSE); if (isset($_POST['userID']) && isset($_POST['building']) && isset($_POST['floor']) && isset($_POST['room'])) { // receiving the post params $userID = $_POST['userID']; $building = $_POST['building']; $floor = $_POST['floor']; $room = $_POST['room']; $company = $_POST['company']; $phone = $_POST['phone']; // check if user is already existed with this user_ID if ($db->isUserIDExisted($userID)) { // create a new user $userAddress = $db->updateUserAddress($userID, $building, $floor, $room, $company, $phone); if ($userAddress) { $response["error"] = FALSE; $response["userAddress"]["building"] = $userAddress["building"]; $response["userAddress"]["floor"] = $userAddress["floor"]; $response["userAddress"]["room"] = $userAddress["room"]; $response["userAddress"]["company"] = $userAddress["company"]; $response["userAddress"]["phone"] = $userAddress["phone"]; echo json_encode($response, JSON_UNESCAPED_UNICODE); } else { // user failed to store $response["error"] = TRUE; $response["error_msg"] = "Unknown error occurred in updating address!";
<?php include_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array //$response = array("error" => FALSE); if (isset($_POST['room_type'])) { // receiving the post params $Br_id = $_POST['branch_id']; $Room_Type = $_POST['room_type']; // check if Room already exists if ($db->isRoomTypeExisted($Room_Type)) { // Room already exists $response["response"] = 0; $response["message"] = $Room_Type . " already exists"; echo json_encode($response); } else { // create a new user$Cust_Name, $Cust_Email, $Cust_Phone,$Cust_Address,$Cust_City,$Cust_State //$user = $db->insertLaboratory($Br_ID, $Lab_Name); $user = $db->insertRoomType($Br_id, $Room_Type); if ($user) { // Room stored successfully $response["response"] = 1; $response["message"] = "Room Type Inserted."; echo json_encode($response); } else { // Room failed to store $response["response"] = 2; $response["message"] = "Unknown error occurred in registration!"; echo json_encode($response); }
<?php include_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array //$response = array("error" => FALSE); if (isset($_POST['br_id']) && isset($_POST['ambulance_id'])) { // receiving the post params $Br_id = $_POST['br_id']; $Ambulance_Type = $_POST['ambulance_type']; $Ambulance_Id = $_POST['ambulance_id']; $Pat_Name = $_POST['pat_name']; $Address = $_POST['address']; $Date = $_POST['date']; $Time = $_POST['time']; $Am_Sch_Id = $_POST['am_sch_id']; if ($_POST['am_sch_id'] == "") { // check if patient already exists if ($db->isAmbulanceSchedule($Ambulance_Id)) { // Bed already allocated $response["response"] = 0; $response["message"] = $Ambulance_Id . " already exists"; echo json_encode($response); } else { // create a new user$Cust_Name, $Cust_Email, $Cust_Phone,$Cust_Address,$Cust_City,$Cust_State $user = $db->insertAmbulanceSchedule($Br_Id, $Ambulance_Type, $Ambulance_Id, $Pat_Name, $Address, $Date, $Time); if ($user) { // Bed allocated successfully $response["response"] = 1; $response["message"] = "Ambulance Scheduled."; echo json_encode($response);
<?php //this file is used for signing up or logging in/out users. include_once "./system/db_functions.php"; include_once './system/db_connect.php'; include_once './system/GCM.php'; $db = new DB_Functions(); if (isset($_POST['username'])) { $user = $db->sanitize($_POST['username']); if (isset($_POST['password'])) { $pass = $db->sanitize($_POST['password']); if (isset($_POST['email'])) { $email = $db->sanitize($_POST['email']); if (isset($_GET['login'])) { $db->login($user, $pass, $email); } if (isset($_GET['signup'])) { $db->signup($user, $pass, $email); } } } else { if (isset($_POST['hash'])) { $hash = $_POST['hash']; if (isset($_GET['logout'])) { $db->logout($user, $hash); } } } }
<?php require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array $response = array("error" => FALSE); if (isset($_POST['tokenName'])) { // receiving the post params $tname = $_POST['tokenName']; // check if user is already existed with the same email // create a new token $token = $db->storeToken($tname); if ($token) { // user stored successfully $response["error"] = FALSE; $response["token"] = $token["token"]; echo json_encode($response); } else { // user failed to store $response["error"] = TRUE; $response["error_msg"] = "Unknown error occurred in registration!"; echo json_encode($response); } } else { $response["error"] = TRUE; $response["error_msg"] = "Required parameters (token) is missing!"; echo json_encode($response); }
<?php /** PHP API for Login, Register **/ if (isset($_POST['tag']) && $_POST['tag'] != '') { //Get the tag $tag = $_POST['tag']; //Include Databse handler require_once 'include/DB_FunctionsSam.php'; $db = new DB_Functions(); //Response Array $response = array("tag" => $tag, "success" => 0, "error" => 0); //Check for tag type if ($tag == 'login') { //Request type is check login $username = $_POST['username']; $password = $_POST['password']; //check for user_error $user = $db->getUser($username, $password); //print_r($user); if ($user != false) { //user found //echo json with success = 1 $response["success"] = 1; $response["user"]["username"] = $user["username"]; //$response["user"]["password"] = $user["encrypted_passwd"]; $response["user"]["created"] = $user["created"]; //print_r($response); echo json_encode($response); } else {
<?php /** PHP API for Login, Register, Changepassword, Resetpassword Requests and for Email Notifications. **/ if (isset($_POST['tag']) && $_POST['tag'] != '') { // Get tag $tag = $_POST['tag']; // Include Database handler require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // response Array $response = array("tag" => $tag, "success" => 0, "error" => 0); // check for tag type if ($tag == 'login') { // Request type is check Login $email = $_POST['email']; $password = $_POST['password']; // check for user $user = $db->getUserByEmailAndPassword($email, $password); if ($user != false) { // user found // echo json with success = 1 $response["success"] = 1; $response["user"]["fname"] = $user["firstname"]; $response["user"]["lname"] = $user["lastname"]; $response["user"]["email"] = $user["email"]; $response["user"]["uname"] = $user["username"]; $response["user"]["uid"] = $user["unique_id"]; $response["user"]["created_at"] = $user["created_at"]; $points = $db->getPointsByUid($user["unique_id"]);
<?php include_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array //$response = array("error" => FALSE); if (isset($_POST['staff_name']) && isset($_POST['staff_email'])) { // receiving the post params $Br_id = $_POST['branch_id']; $Staff_Name = $_POST['staff_name']; $Staff_Email = $_POST['staff_email']; $Staff_dob = $_POST['staff_dob']; $Staff_Gender = $_POST['staff_gender']; $Staff_Phone = $_POST['staff_phone']; $Staff_Addr1 = $_POST['staff_addr1']; $Staff_Addr2 = $_POST['staff_addr2']; $Staff_Postal_Code = $_POST['staff_postal_code']; $Dept_id = $_POST['dept_id']; $Designation_id = $_POST['designation_id']; $Staff_Joining_Date = $_POST['staff_joining_date']; $Login_uname = $_POST['staff_name']; $Login_name = $_POST['staff_email']; $Login_password = '******'; $Login_type = 'staff'; // check if staff already exists if ($db->isStaffExisted($Staff_Email)) { // staff already exists $response["response"] = 0; $response["message"] = $Staff_Email . "already exists"; echo json_encode($response); } else {
<?php require_once '../include/DB_Functions.php'; $db = new DB_Functions(); $id = $_POST['id']; $user = $db->getUserByID($id); if ($user != false) { // user found $response["error"] = FALSE; $response["uid"] = $user["unique_id"]; $response["user"]["name"] = $user["name"]; $response["user"]["email"] = $user["email"]; $response["user"]["created_at"] = $user["created_at"]; $response["user"]["updated_at"] = $user["updated_at"]; echo json_encode($response); } else { // user not found // echo json with error = 1 $response["error"] = TRUE; $response["error_msg"] = "Usuário não encontrado!"; echo json_encode($response); }
} ul.devices li .send_btn{ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#0096FF), to(#005DFF)); background: -webkit-linear-gradient(0% 0%, 0% 100%, from(#0096FF), to(#005DFF)); background: -moz-linear-gradient(center top, #0096FF, #005DFF); background: linear-gradient(#0096FF, #005DFF); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); border-radius: 3px; color: #fff; } </style> </head> <body> <?php include_once 'funciones.php'; $db = new DB_Functions(); $users = $db->getAllUsers(); if ($users != false) { $no_of_users = mysql_num_rows($users); } else { $no_of_users = 0; } ?> <div class="container"> <h1>N° de dispositivos registrados: <?php echo $no_of_users; ?> </h1> <hr/> <ul class="devices"> <?php
<?php require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array $response = array("error" => 0); if (isset($_POST['username']) && isset($_POST['passHash'])) { // receiving the post params $username = $_POST['username']; $passHash = $_POST['passHash']; // get the user details $user = $db->getUserDetails($username); if ($user != NULL) { // user is found , now check for the correct login credentials $salt = $user["salt"]; if ($db->checkPassHash($salt, $passHash) == $user["password"]) { $response["error"] = 0; $response["user"]["uuid"] = $user["uuid"]; $response["user"]["name"] = $user["name"]; $response["user"]["email"] = $user["email"]; $response["user"]["phoneno"] = $user["phoneno"]; $response["user"]["wallet"] = $user["wallet"]; echo json_encode($response); } else { $passwordRecv = $db->checkPassHash($salt, $passHash); // wrong login credentials $response["error"] = 1; $response["error_msg"] = "Login credentials wrong."; $response["passHash"] = $passHash; $response["salt"] = $salt; $response["passwordRecv"] = $passwordRecv;
Esta página ofrece un formulario dinámico con jquery donde elegir respuestas a preguntas sobre los principios de la Computación Centrada en la Persona y los envía a otro script para ser procesadas. */ // Comprobando que haya sido superado el acceso como participante if (!isset($_COOKIE['destinatario']) || !isset($_COOKIE['target'])) { header("Location: http://localhost/HCXET/Estudio/formestudio.php"); die; } // Importando clase de consultas require_once '../Web/Classes/DB_functions.php'; // Captura de datos $id_destinatario = $_COOKIE['destinatario']; $id_target = $_COOKIE['target']; // Instancia de objeto consultas $db = new DB_Functions(); // Nombre del estudio actual $study = $db->getNombreestudio($id_target); $sistema = $db->getNombresistema($id_target); ?> <!DOCTYPE html> <html lang = "en"> <head> <!-- --------------------------------------------------------------------------- Project: Human Centeredness experimental evaluation tool Author: Olga Peñalba, Miguel Revuelta Date: 2015-09-1 Version: 2.1 (english)
<!DOCTYPE html> <?php require_once 'include/DB_Functions.php'; $db = new DB_Functions(); if (isset($_POST['caretaker'])) { $care_taker_name = $_POST['care_taker_name']; $care_taker_address = $_POST['care_taker_address']; $care_taker_contact = $_POST['care_taker_contact']; $care_taker_attendance = $_POST['care_taker_attendance']; $care_taker_availability_time = $_POST['care_taker_availability_time']; $care_taker_working_hours = $_POST['care_taker_working_hours']; // include db handler // response Array $status = $db->insert_caretaker($care_taker_name, $care_taker_address, $care_taker_contact, $care_taker_attendance, $care_taker_availability_time, $care_taker_working_hours); // if($status!=-1){ // echo 'Inserted Successfully'; // }else{ // echo 'Error in insertion'; // } } ?> <html> <head> <title>Plant Nursery</title> <link rel="stylesheet" type="text/css" href="css/reset.css" /> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="css/animate.css" /> <link rel="stylesheet" type="text/css" href="css/custom.css" /> <link rel="stylesheet" type="text/css" href="css/jquery.timepicker.css" /> <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<?php require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array $response = array("error" => FALSE); $email = $_GET['email']; $password = $_GET['mdp']; // get the user by email and password $user = $db->getUserByEmailAndPassword($email, $password); if ($user != false) { // use is found $response["error"] = FALSE; $response["nom"] = $user["nom"]; $response["prenom"] = $user["prenom"]; $response["id"] = $user["id"]; echo json_encode($response); } else { // user is not found with the credentials $response["error"] = TRUE; $response["error_msg"] = "L'email ou le mot de passe est faux"; echo json_encode($response); }
<?php if (!isset($_SESSION)) { session_start(); } if (!isset($_SESSION['email']) || !isset($_POST['rowid']) || !isset($_POST['registration']) || !isset($_POST['reqtime']) || !isset($_SESSION['loggedIn'])) { header("location:index.php"); exit; } $email = $_SESSION['email']; $reg = $_POST["registration"]; $rowId = $_POST["rowid"]; $reqTime = intval($_POST["reqtime"]); include_once './db_functions.php'; $db = new DB_Functions(); if (!$db->userDeviceVerify($rowId, $email)) { header($_SERVER["SERVER_PROTOCOL"] . " 507 User Not Authorized for Device"); exit; } $updTime = 1; $updTime = $db->getPictureDIRUpdateTime($reg); if ($reqTime > $updTime) { header($_SERVER["SERVER_PROTOCOL"] . " 204 No Content"); exit; } header($_SERVER["SERVER_PROTOCOL"] . " 200 OK"); $picture_dirs = $db->getPictureDir($reg); $fxr = explode("}", $picture_dirs); $paragraphs = $fxr[0]; for ($i = 1; $i < count($fxr) - 1; $i += 1) { $paragraphs .= '},' . $fxr[$i];
<?php require_once 'include/DB_Functions.php'; $db = new DB_Functions(); // json response array $response = array("error" => FALSE); if (isset($_POST['fingerprint'])) { $fingerprint = $_POST['fingerprint']; $m = $_POST['m']; $maj = $db->leastAvgError($fingerprint, $m); if ($maj) { } else { } } else { }