02 2021 档案
摘要:如:html用公用代码可以使用smarty include引入 {include file='header.html'}
阅读全文
摘要:我们在检验用户名是否合法的sql语句是这样的 select * from my_user where user='$id' and pwd=$pwd; 如果我们输入的是‘or 1 #,此时的sql语句变成了 select * from my_user where user='' or 1 # and
阅读全文
摘要:我们在login页面中已经添加了对用户名和密码的检验是否合法,但是如果在页面中输入index.php?p=back&c=Index&a=index,那么就不会通过login界面,直接进入到后台首页 怎么解决呢? 引入平台控制器类,PlateFormController.class.php,why?为
阅读全文
摘要:如php const login_info="this is my blog,you are tight"; html接收太长,显示10个,后面用....代替 {$smarty.const.login_info | truncate:10:"...."}
阅读全文
摘要:如在php中const login_time=time(); 在html中接收 {$smarty.const.login_time | date.format: '%Y-%m-%d'} 就会显示出时间的格式了;
阅读全文
摘要:在项目实施时,用户只能访问根目录下 index.php 入口文件 或者一些公共的文件,那app 程序代码目录 或者Framework 框架核心 是不允许访问的,那怎么解决? 使用.htaccess来控制哪些文件夹可以访问,哪些不可以被访问 比如 : 我们正常访问 localhost 回车后,就会进入
阅读全文
摘要:<?php include './Vendor/Smarty.class.php'; $smart=new Smarty(); define("CC","中国制造"); $arr=array( "0" => array( "id" =>"001", "name" => "小伟", ), "1" =>
阅读全文
摘要:Smarty都能传递什么参数 普通变量 string bool int 数组 array 常量 define、const定义的 系统常量 等等 Smarty接收常量在php IMG_DIR定义的 <img src="{$smarty.const.IMG_DIR}/logo.png" class="r
阅读全文