随笔分类 - thinkphp3.1.3
是以 thinkphp 3.1.3版本为蓝本的点点滴滴记录!
摘要:form表单中 enctype="multipart/form-data" public function upload() { import('ORG.Net.UploadFile'); $upload = new UploadFile(); // 实例化上传类 $upload->maxSi...
阅读全文
摘要:在控制器中定义一个控制器,一定要开启 sessionclass PublicAction extends Action { public function verify() { session('[start]'); import('ORG.Util.Image'); Image::build...
阅读全文
摘要:$dd = Db::getInstance(); //实例连接数据库$sql = "SELECT * FROM `yezi_friendlinks`"; // SQL$res = $dd->query($sql); // 查询$tt = print_r($res, true); // 结果// $t...
阅读全文
摘要:1.根据条件计算出数据的总数2.import(page类);3.实例化分页类4.设置相关的参数5.调用show()方法// 导入分页类 import('ORG.Util.Page');$p = new Page($numrow,2);//$numrow为总记录数,2为页的记录数.....$p->se...
阅读全文
摘要:模板文件:如 index.html模板文件如:(index.html)控制器文件:如 CheckAction.class.phpwhere("user='{$u}'")->count();if($count){echo '1';}else{echo '0';}}?>
阅读全文
摘要:部署模式可用两个单入口表示前后台thinkphpUploadspublicHome(前台)Admin(后台)index.php(前台入口文件)admin.php(后台入口文件)上面两个项目目录也可以用分组开式,此时简化了一个项目目录ThinkphpApp(Home/Admin)publicUploa...
阅读全文
摘要:首先得引入 jquery 文件,另外定义一个处理的 js.js 文件如实现用 post 传输方法:模板文件:js.js 内容如下:$(document).ready(function(){$('#sub').click(function(){var user = $('input[name=username]');var content = $('textarea[name=content]');if(user.val() == ''){alert("USER: 不能为空!");return false;}if
阅读全文
摘要:首先建立数据表,可在ThinkPHP/Extend/Driver/Session/SessionDb.class.php中copy代码在配置文件中配置:'SESSION_TYPE' => 'db', 'SESSION_TABLE' => 'think_session', // 与表的全名...
阅读全文