本文整理汇总了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) {