Beispiel #1
0
<?php

//示例(手机发送消息)
include '../SaeMemcache.php';
include '../SaeMySQL.php';
include '../My.php';
header('Content-Type:text/html;charset=utf-8');
if (MySetParameterInteger("order_id") === false) {
    MyException("缺少order_id参数");
}
if (MySetParameter("information") === false) {
    MyException("缺少information参数");
}
if (MySetParameterInteger("user_id") === false) {
    MyException("缺少user_id参数");
}
$stamp = time();
$time = date("Y-m-d H:i:s", $stamp);
$key = 'phone_to_pc【' . $user_id . '】';
//写法1:
/*
$value = SaeMemcacheRead($key);
if($value===false){
	$value = array(array("order_id"=>$order_id,"information"=>$information,"stamp"=>$stamp,"time"=>$time));
	if(SaeMemcacheSet($key,$value)===false){
		MyError("Memcache写入失败");
	}
}
else{
	$value[] = array("order_id"=>$order_id,"information"=>$information,"stamp"=>$stamp,"time"=>$time);
	if(SaeMemcacheSet($key,$value)===false){
Beispiel #2
0
<?php

//用户上传文件
//By:MoonLord
//2015.11.14
header('Content-Type:text/html;charset=utf-8');
include 'MyPHP/My.php';
include 'MyPHP/MySQLi.php';
//参数
$user_id = MySessionGet('user_id');
if ($user_id === false) {
    MySuccess(1, '用户未登录');
}
if (MySetParameterInteger("group_id") === false) {
    MyException("缺少group_id参数或group_id不是整数");
}
if (MySetParameter("path") === false) {
    $path = '';
    //MyException("缺少path参数");
}
//权限验证
if (MySQLConnect() === false) {
    MyError('数据库连接错误');
}
$authority = MySQLSelectCell("SELECT `authority` FROM `user_group_info` WHERE `user_id` = {$user_id} and `group_id` = {$group_id}");
MySQLDisconnect();
if ((int) $authority < 2048) {
    MySuccess(2, '用户权限不足');
}
//文件保存
if (!isset($_FILES) || !isset($_FILES["file"])) {