Skip to content

Instantly share code, notes, and snippets.

View edk24's full-sized avatar
:octocat:
Hello~

余晓波 edk24

:octocat:
Hello~
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>files-h5</title>
</head>
<body>
<input type="file" id="file" onchange="showPreview(this, 'portrait')" />
<img src="" id="portrait" style="width: 200px; height: 200px; display: block;" />
<script>
@edk24
edk24 / core\MY_Controller.php
Created May 14, 2019 05:50
CodeIgniter 控制器, 检测用户是否登录
<?php
/**
* 初始控制器
*/
class MY_Controller extends CI_Controller
{
// 是否检查用户登录状态
public $check_login = true; // 默认检查用户是否登录, 子类可以在 __construct() 中禁用它
public function __construct()
@edk24
edk24 / helper\redirect_helper.php
Last active May 14, 2019 05:33
CodeIgniter重定向跳转提示函数, jump_error / jump_success 抠自ThinkPHP3.x
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
if (!function_exists('success'))
{
function jump_success($msg='操作成功', $url='javascript:history.go(-1);', $wait=2)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">