It is currently Tue Feb 21, 2017 2:19 pm

News News of PHP

Site map of PHP » Forum : PHP

PHP back-end for CrossUI

CrossUI PHP Backend Demo

xuiservice.php:

<?php
// input and output keys
define('XUI_KEYWORD_CALLBACK', "callback");
define('XUI_KEYWORD_DATA', "data");
define('XUI_KEYWORD_ERROR', "error");

// for json
if(!function_exists('json_encode')){
include_once("JSON.php");
function json_encode($var){
return (new JSON).encode($var);
}
function json_decode($str){
return (new JSON).decode($str);
}
}

// handle request data
function xui_getRequestData(){
$callback = XUI_KEYWORD_CALLBACK;
$inputData=new stdClass;

// 1. for "post" request
// 1.1. form post( a=b$c=d )
if(count($_POST)>0){
foreach ($_POST as $k=>$v)
$inputData->$k = get_magic_quotes_gpc()?stripslashes($v):$v;
// 1.2. form post( {a:'b',c:'d'} ) or xmlhttp post
}else{
$request = file_get_contents('php://input');
if($request){ ...
Read more : CrossUI PHP Backend Demo | Views : 5677 | Replies : 0


 

Login  •  Register


Statistics

Total posts 934 • Total topics 315 • Total members 35

cron