本文整理匯總了PHP中DB_Functions::getContacts方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_Functions::getContacts方法的具體用法?PHP DB_Functions::getContacts怎麽用?PHP DB_Functions::getContacts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DB_Functions
的用法示例。
在下文中一共展示了DB_Functions::getContacts方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
$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->getContactsUpdateTime($reg);
error_log("rtime " . $reqTime);
error_log("updTime " . $updTime);
if ($reqTime > $updTime) {
header($_SERVER["SERVER_PROTOCOL"] . " 204 No Content");
exit;
}
header($_SERVER["SERVER_PROTOCOL"] . " 200 OK");
$contactslist = $db->getContacts($reg);
$mxr = explode("}", $contactslist);
$paragraphs = $mxr[0];
for ($i = 1; $i < count($mxr) - 1; $i += 1) {
$paragraphs .= '},' . $mxr[$i];
}
if ($paragraphs == "") {
echo "[]";
} else {
$paragraphs .= '}';
echo '[' . stripslashes($paragraphs) . ']';
}
示例2: header
<?php
if (!isset($_SESSION)) {
session_start();
}
// receive data from HTML readsms request
if (!isset($_SESSION['registration']) && !isset($_SESSION['rowid'])) {
header("location:index.php");
exit;
}
$rName = $_SESSION["registration"];
$rowId = $_SESSION["rowid"];
include_once '../db_functions.php';
$db = new DB_Functions();
$contactslist = $db->getContacts($rName);
$mxr = explode("}", $contactslist);
$paragraphs = $mxr[0];
for ($i = 1; $i < count($mxr) - 1; $i += 1) {
$paragraphs .= '},' . $mxr[$i];
}
if ($paragraphs == "") {
echo "[]";
} else {
$paragraphs .= '}';
echo '[' . stripslashes($paragraphs) . ']';
}