随笔分类 - CI框架
摘要:今天遇到在用CI框架上传csv文件时报错问题:Thefiletypeyouareattemptingtouploadisnotallowed.是类型不允许,想到CI框架的config/mimes.php的配置,发现已经有csv的mimes配置,而且在win7下是可以上传的于是百度之,半天没结果,果然换google,找到如下的记录:The answer to my problem was with MIME types—I’ll leave this comment up here in case it is related. My CSV was returning with a MIME t
阅读全文
摘要:之前做的项目用到CI框架和amfphp的整合,主要用于php与flex的交互,在此做一下记录:一. 安装CI框架:1. 搭建PHP运行环境,本人在WIN7下用WAMP作测试,安装目录:d:/wamp/www2. 下载CI框架,在官网http://codeigniter.org.cn/downloads 下载最新版本,解压打包。3. 将CI文件架名称修改为ciamfphp,并存在到d:/wamp/www,开通虚拟域名, 绑定HOST为: www.ciamfphp.cc,设置好之后访问此域名,如果见到CI框架的欢迎界面,说明搭建CI框架成功。二.下载: amfPhp 1.9 网址:http:...
阅读全文
摘要:load->database(); } /** * 分页数据查询 * 功能: * 一、查询条件分页总数 * 二、查询条件分页数据信息 * @param string $table 表名称 * @param array $param 查询条件: * array($key => $val) $key为要操作的字段,$val为要操作的值 * @param string $type 为total返回总数,...
阅读全文
摘要:/** * 多字段条件查询数据 * @param array $val array("name" => $value)。name为要操作的字段,value为要操作的值 * @param int $limit 数据数目 * @param int $offset 开始位置 * @param string $show_field 要显示字段 * @param array $order array("name" => $value): * ...
阅读全文
摘要:上传 flv格式文件一致提示文件类型不允许,是因为CI中的配置文件没有支持这个格式在 application/config/mimes.php中加入'flv' => array('video/flv', 'video/x-flv', 'flv-application/octet-stream', 'application/octet-stream'),就可以了前端播放flv使用 JW player播放器,官网地址为:http://www.jwplayer.com/播放代码为:
阅读全文
摘要:marker[$name] = microtime(); } // -------------------------------------------------------------------- /** * Calculates the time difference between two marked points. * * If the first parameter is empty this function instead returns the * {elapsed_time} pseudo-variable. This...
阅读全文
摘要:1、CI框架版本: /** * 自动过滤变量,进行XSS,去空 * 支持:单个字符串,多维数组,数字 * @param type $param = '常规字符串' 或 array('字符串1','字符串2'); * @return string|array */ final protected fu
阅读全文
摘要:<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');set_time_limit(0);class Img_build extends CI_Controller{ private static $img_path = 'upload_old/'; private static $new_path = 'upload/'; function __construct() { parent::__construct(); ...
阅读全文
摘要:<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class MyEmail extends CI_Controller { public function __construct() { parent::__construct(); } public function index( $param=array() ) { $config = array( ...
阅读全文
摘要:在设置好CI框架的配置文件 config.php文件后,发现session不起效果经过检测发现原来是配置文件的 $config['cookie_domain']= ".ceshi.cc/" 多了后面的符号 '/' 导致session失效去除 '/' $config['cookie_domain']= ".ceshi.cc" 后session正常使用。CI框架的session保存在cookie,如果session保存的数据大于4K会导致一部分session内容失效,可以将比较大的信息保存到缓存
阅读全文
摘要:在视图文件加上这样一行代码:<!-- 设置js和css访问图片路径 --><base href="<?php echo base_url();?>"/><!-- 设置js和css访问图片路径 end -->就可以按照根路径添加 js和css文件,在css文件里图片路径写成相对路径即可,如:<script src="data/js/jquery.min.js" type="text/javascript"></script><link href="d
阅读全文

浙公网安备 33010602011771号