Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///INDEX PHP
- <?php
- ////hide all error
- // error_reporting(0);
- // ini_set('display_errors', 0);
- //show all error
- error_reporting(E_ALL);
- ini_set('display_errors', 1);
- // ini_set('display_errors', 1);
- // ini_set('display_startup_errors', 1);
- // error_reporting(E_ALL);
- // error_reporting(E_ALL);
- // ini_set('display_errors', 'On');
- include 'inc/init.php';
- global $serverAuth;
- $module = $_GET['module'];
- $function = $_GET['function'];
- $auth = $_POST['auth'];
- $response = array(
- "responseInfo" => array(
- "module" => $module,
- "function" => $function,
- "status" => null,
- "message" => null,
- ),
- );
- if($auth != $serverAuth){
- $response['responseInfo']['status'] = 'failed';
- $response['responseInfo']['message'] = 'not authorize to access.please contract administrator.';
- header('Content-Type: application/json');
- echo json_encode($response);
- }else{
- if($module == "auth"){
- include './route/auth.php';
- }
- if($module == "tender"){
- include './route/tender.php';
- }
- if($module == "route"){
- include './route/simple.php';
- }
- }
- ?>
- // route/simple.php
- <?php
- if($module == "route" && $function == "route"){
- simpleRoute();
- }
- function simpleRoute(){
- $response['responseInfo']['status'] = 'Success';
- $response['responseInfo']['message'] = 'Response from Server';
- $response['responseInfo']['ssmNo'] = '567940-T';
- header('Content-Type: application/json');
- echo json_encode($response);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment