本文整理匯總了PHP中global_common::cors方法的典型用法代碼示例。如果您正苦於以下問題:PHP global_common::cors方法的具體用法?PHP global_common::cors怎麽用?PHP global_common::cors使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類global_common
的用法示例。
在下文中一共展示了global_common::cors方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Model_Tracker
<?php
/* TODO: Add code here */
require 'config/globalconfig.php';
include_once 'class/model_user.php';
include_once 'class/model_tracker.php';
$objTracker = new Model_Tracker($objConnection);
$objUser = new Model_User($objConnection);
global_common::cors();
$request_body = file_get_contents("php://input");
//echo $request_body;
if ($request_body && global_common::isJson($request_body)) {
$_pgR = json_decode($request_body, true);
}
if ($_pgR["act"] == Model_Tracker::ACT_ADD) {
$userName = $_pgR[global_mapping::UserName];
$user = $objUser->getUserByName($userName);
$trackType = $_pgR[global_mapping::TrackType];
$value = $_pgR["Value"];
$description = $_pgR["Description"];
$trackerID = $objTracker->insert($user[global_mapping::UserID], $trackType, $value, $description);
echo json_encode($trackerID);
} else {
if ($_pgR["act"] == Model_Tracker::ACT_GET_USER) {
$userName = $_pgR[global_mapping::UserName];
$user = $objUser->getUserByName($userName);
$storeID = $_pgR[global_mapping::StoreID];
$tracker = $objTracker->getTrackerUser($user[global_mapping::UserID], $storeID);
echo json_encode($tracker);
} else {
if ($_pgR["act"] == 15) {