- 博客(23)
- 资源 (1)
- 收藏
- 关注
转载 在html中引入在线编辑器的代码
"disp.php" method="post">//引用FCKeditor.php这个文件,基本的类和数据结构都在这里include ("fckeditor/fckeditor.php");//创建FCKeditor对象的实例。myFCKeditor即提交后,接收数据页面 _POST['myFCKeditor']使用$FCKeditor = new FCKeditor("co
2011-11-24 17:18:52 600
原创 smarty与php实现新闻管理的代码(二)
login.php文件require('./mysql.php');$username=$_REQUEST['username'];$passwd=$_REQUEST['passwd'];session_start();$_SESSION['s_username']=$username;$query_user="select * from user where user
2011-11-23 20:06:26 342
原创 smarty与php实现新闻管理的代码(一)
index.php文件require('./global.php');require('./smarty/libs/Smarty.class.php');require('./mysql.php');require('./FCKeditor/fckeditor.php');$action=$_REQUEST['action'];//定义一个函数用于调用FCKfu
2011-11-22 14:41:35 519
原创 smarty知识总结
1. 自定义函数(自定义标签)1) php文件function定义函数注册步骤(register_function(),register_block())Tpl文件类似于html标签成对出现---块…….2)当做插件./pugins*.function*.phpFunctionsmarty_function*.block*.phpFunc
2011-11-21 14:36:14 213
原创 smarty与php缓存的操作
1)使用缓存要开启smarty的缓存,只需将caching设为true,并指定cache_dir即可。使用cache_lefetime指定缓存生存时间,单位为秒2)清楚缓存Clear_all_cache();//清除所有缓存Clear_cache(“index.tpl”);//清除index.tpl的缓存Clear_cacache(“index.tpl”,cache_id);/
2011-11-18 11:53:32 196
原创 smarty内置函数实例代码(二)与运行结果截图
header.html文件这是头文件 演示用法init.inc.phprequire("./libs/Smarty.class.php");$tpl = new Smarty();$tpl->template_dir ='./templates';$tpl->compile_dir ='./templates_c';$tpl->left_de
2011-11-17 15:48:34 183
原创 smarty内建函数的实例代码(一)
b,php文件include("./init.inc.php");$tpl->assign("name","abc");//连接数据库,产生连接对象$mysqli$mysqli = new mysqli("localhost","root","","product");//执行SQL语句,返回结果集对象$result$result = $mysqli->query("s
2011-11-17 15:29:21 243
原创 smarty自定义函数的实例代码
b.php文件include("./init.inc.php"); $tpl->assign("title","abc"); //注册自定义函数 //$tpl->register_function("smarty中的自定义函数名","php中的自定义函数名"); $tpl->register_function("title","fun1"); //
2011-11-16 19:09:03 286
原创 php面向对象实例代码
class Person{//下面是人的成员属性var $name; //人的名子var $sex; //人的性别var $age; //人的年龄//下面是人的成员方法function say() //这个人可以说话的方法{echo "这个人在说话";}function run() //这个人可以走路的
2011-11-15 20:16:17 841
原创 smarty实现分页代码(二)
a.html文件 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">smarty分页产品名称产价格品产品描述{section name="bb" loop="$aaa"}{$aaa[bb].productID
2011-11-14 17:10:24 349
原创 smarty实现分页代码(一)
b.php文件 require_once("configs.php");$sql="select * from product";$rs=$mysqli->query($sql);$count=$rs->num_rows;$num=4;$pagecount=ceil($count/$num);if(@$_GET['page']==""||$_GET['page']
2011-11-14 17:09:38 309
原创 Smarty 使用步骤
1) smarty.class.php var $config_dir = 'configs';2) 编辑init.inc.php$tpl->config_dir = ‘configs’;3)到web跟文档目录之外位置新建文件configs4)建立文件configs/foo.conf5)编辑foo.conf文件内容 #表示注释行 自定
2011-11-14 16:32:27 281
原创 Smarty实现的代码(二)
b.php文件include("./init.inc.php");$a=10;$tpl->assign("title","this is php various");$tpl->assign("title1","$a");$tpl->assign("title2","true"); //从数据库lianxi,表user获取//连接数据库使用内置类mysql
2011-11-14 10:15:04 250
原创 smarty实现的代码(一)
lint.inc.php文件 require("../libs/Smarty.class.php");define(ROOT,'D:/wamp/www/smarty/smarty');//创建模板对象 $tpl = new Smarty();$tpl->template_dir = ROOT.'/tpl';$tpl->compile_dir = ROOT.
2011-11-09 19:46:01 234
原创 smarty的一些特点
执行效率高仅对修改过的模板文件进行重新编译,可以编辑“自定义模板和自定义”变量“,模板语言可以扩展可以自行设置模板定界符引擎可以订制,可以嵌入php代码支持内建缓存。可以自定义缓存处理函数独立模板文件如果允许的话,section之间可以无限嵌套
2011-11-08 17:21:15 394
原创 smarty的代码
//本文件使用模板类//首先包含该模板文件include("MyTpl.php");//创建模板对象 new$tpl = new MyTpl();$title="smarty学习";$content="smarty模板的介绍"; //分配变量$tpl->assign("title",$title);$tpl->assign("content",$conte
2011-11-08 16:55:37 243
原创 留言板
submit的代码 // 禁止非 POST 方式访问if(!isset($_POST['submit'])){ exit('非法访问!');}// 表单信息处理if(get_magic_quotes_gpc()){ $name = htmlspecialchars(trim($_POST['name'])); $email = htmlspec
2011-11-07 17:53:13 272
原创 留言板
aplay的代码 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/1999/xhtml">管理员留言require("conn.php");require("config.php");$query_sql = "SELECT * FROM lyb
2011-11-07 17:48:59 423
原创 过滤信息
从表单接受到$_POST[‘*’]该信息内容可能包括“‘空格 特殊符号例如 “user ‘’’’abc”$_POST[‘pass’]=“” and(select * from tbl_user)”防注入(攻击)PHP安全问题:1、 注入SQL在用户执行注册过程中口令内容部分使用了类似(select insert update delete and or etc.)
2011-11-07 17:20:01 374
原创 支付宝代码
require_once("alipay.config.php");require_once("lib/alipay_notify.class.php");?> //计算得出通知验证结果$alipayNotify = new AlipayNotify($aliapy_config);$verify_result = $alipayNotify-
2011-11-07 17:06:30 1890
原创 购物车的代码
car1.php的代码 //检验$_POST相关信息if(isset($_POST['submit'])){ print($_POST['car']);}?>日用百货 毛巾 牙膏 牙刷 香皂 car.php的代码//从tb_product_type表获取产品类别信息,显示到首页//步骤
2011-11-07 16:54:29 1093
原创 购物车的代码
网上商城 用户名: 密码: 不保存 ?php//本页面功能:显示购物车内的商品(商品名称、商品数量)session_start();echo "您已经选择的商品包括:"; echo ""; //显示用户购买的商品 //包括功能:删除该商品 //修改商品的数量 //获取用户购买的信息$
2011-11-02 20:36:46 1746
原创 购物车实现原理
1、 功能1) 商品展示---相关资料(基本描述、价格、名称、供应商情况、图片等)2) 购物车功能购物车相当于现实中超市的购物车,但是网页实现的是一个虚拟行为用户可以在购物车网站不同页面之间的任意跳转,选购自己喜欢的商品,点击购买—订单信息—统一到付账台结账购物车功能包括ü 添加商品—订购ü 删除商品ü 修改商品的购物数量(小计、总计)ü 清空购物车
2011-11-01 21:01:13 5443
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人