<?php
header("Content-type: text/html; charset=utf-8");
header('Access-Control-Allow-Origin:*');
$BiaDuak = '************';//定义变量 使用时 echo $BiaDuak;
define("accessKeyId","************");//定义常量 使用时 echo accessKeyId;
define("accessKeySecret","************");
define("endpoint","************");
//公共类
class DbHelp
{
private $servername="************.com:4065";
private $username="root" ;
private $password="w386161506";
private $dbname="allhelp_db";
public $conn;
private static $_instance;
public static function getInstance()
{
if(! (self::$_instance instanceof self) )
{
self::$_instance = new self();
}
return self::$_instance;
}
private function __construct(){
$this->conn=new mysqli($this->servername,$this->username,$this->password,$this->dbname);
}
private function __clone(){}
}
//公共函数
function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
function create_guid() {
$charid = strtoupper(md5(uniqid(mt_rand(), true)));
$hyphen = chr();// "-"
$uuid =
substr($charid, , )
.substr($charid, , )
.substr($charid,, )
.substr($charid,, )
;
return $uuid;
}
function guid(){
if (function_exists('com_create_guid')){
return com_create_guid();
}else{
mt_srand((double)microtime()*);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr();// "-"
$uuid = chr()// "{"
.substr($charid, , ).$hyphen
.substr($charid, , ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,,)
.chr();// "}"
return $uuid;
}
}
function createguid() {
$charid = strtoupper(md5(uniqid(mt_rand(), true)));
$hyphen = chr();// "-"
$uuid =
substr($charid, , ).$hyphen
.substr($charid, , ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,, ).$hyphen
.substr($charid,,)
;
return $uuid;
}
//用于继承的基类
class DbHelpBase
{
public $servername;
public $username;
public $password;
public $dbname;
public $conn;
public function DbHelpBase(){
$this->servername="************:4065";
$this->username="root" ;
$this->password="w386161506";
$this->dbname="allhelp_db";
$this->conn=new mysqli($this->servername,$this->username,$this->password,$this->dbname);
}
public function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
public function create_guid() {
$charid = strtoupper(md5(uniqid(mt_rand(), true)));
$hyphen = chr();// "-"
$uuid =
substr($charid, , )
.substr($charid, , )
.substr($charid,, )
.substr($charid,, )
;
return $uuid;
}
}
//用于组合的类
class DbHelpField
{
public $servername;
public $username;
public $password;
public $dbname;
public $conn;
private static $_instance;
public static function getInstance()
{
if(! (self::$_instance instanceof self) )
{
self::$_instance = new self();
}
return self::$_instance;
}
private function __construct(){
$this->servername="************:4065";
$this->username="root" ;
$this->password="w386161506";
$this->dbname="allhelp_db";
$this->conn=new mysqli($this->servername,$this->username,$this->password,$this->dbname);
}
private function __clone(){}
public function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
public function create_guid() {
$charid = strtoupper(md5(uniqid(mt_rand(), true)));
$hyphen = chr();// "-"
$uuid =
substr($charid, , )
.substr($charid, , )
.substr($charid,, )
.substr($charid,, )
;
return $uuid;
}
}
?>