// 管理员登录
function checkLogined() {
$_SESSION['adminId'] = empty($_SESSION['adminId'])? null : $_SESSION['adminId'];
$_COOKIE['adminId'] = empty($_COOKIE['adminId'])? null : $_COOKIE['adminId'];
if ($_SESSION['adminId'] =="" && $_COOKIE['adminId'] == "") {
alertMes("进入失败,请登录", "login.php");
}
}
function checkLogined() {
$_SESSION['adminId'] = empty($_SESSION['adminId'])? null : $_SESSION['adminId'];
$_COOKIE['adminId'] = empty($_COOKIE['adminId'])? null : $_COOKIE['adminId'];
if ($_SESSION['adminId'] =="" && $_COOKIE['adminId'] == "") {
alertMes("进入失败,请登录", "login.php");
}
}
2017-05-01
// 查询所有的分类,返回一个数组
function getAllCate() {
$sql = "select id,cName from imooc_cate order by id asc";
return fetchAll($sql);
}
function getAllCate() {
$sql = "select id,cName from imooc_cate order by id asc";
return fetchAll($sql);
}
2017-05-01
如果不选择文件就点击上传会发生错误: Notice: Undefined variable: uploadFiles
可把
return $uploadFiles;
改为
return $uploadFiles = empty($uploadFiles)? null : $uploadFiles;
可把
return $uploadFiles;
改为
return $uploadFiles = empty($uploadFiles)? null : $uploadFiles;
2017-04-30
可以在关键页面前加:
<?php
require_once '../include.php';
checkLogined();
?>
<?php
require_once '../include.php';
checkLogined();
?>
2017-04-30
$page = empty($_REQUEST['page'])? 1 : intval($_REQUEST['page']); // 当前页
2017-04-29
大家若遇到值为定义时,可使用下面的方法:
$id = empty($_REQUEST['id'])? null : $_REQUEST['id'];
$id = empty($_REQUEST['id'])? null : $_REQUEST['id'];
2017-04-29
最新回答 / hugohugo
下载服务器APACHE 和php 配置环境,将整个项目文件放在APACHE目录下的bin-htdocs,启动APACHE ;在网页上输入网址就可以访问了。配置环境那些百度有很多
2017-04-29