摘要: selectAdd 以搜索方式插入一条数据 阅读全文
posted @ 2012-12-13 11:29 Thinking In Code 阅读(260) 评论(0) 推荐(0) 编辑
摘要: /** * 动态切换扩展模型 * @access public * @param string $type 模型类型名称 * @param mixed $vars 要传入扩展模型的属性变量 * @return Model */ public function switchModel($type,$vars=array()) { $class = ucwords(strtolower($type)).'Model'; if(!class_exists($class)) throw_excep... 阅读全文
posted @ 2012-12-13 10:15 Thinking In Code 阅读(1819) 评论(1) 推荐(0) 编辑
摘要: Socket函数socket_accept接收一个Socket连接socket_bind把socket绑定一个IP地址和端口socket_clear_error清除socket的错误或者最后的错误代码socket_close关闭一个socket资源socket_connect开始一个socket连接socket_create_listen在指定端口打开一个socket监听socket_create_pair产生一堆没有区别的socket到一个数组里socket_create创建一个socket,相对于产生一个socket的数据结构说明:创建并返回一个套接字资源,也称为一个端点的通信。一个典型的 阅读全文
posted @ 2012-12-05 11:46 Thinking In Code 阅读(1575) 评论(0) 推荐(0) 编辑
摘要: 首先继承Widget类,然后使用rander方法调用所需的数据通过renderFile方法把数据返回到Action中 即可自定义标签模块在模板中调用使用{:W('ShowComment',array('count'=>5))}数组也可以改成字符串传入然后再进行数据组合 阅读全文
posted @ 2012-11-29 15:51 Thinking In Code 阅读(1417) 评论(0) 推荐(0) 编辑
摘要: 今天写下php中,如何通过各种方法 获取当前系统时间、时间戳,并备注各种格式的含义,可灵活变通。1、获取当前时间方法date()很简单,这就是获取时间的方法,格式为:date($format, $timestamp),format为格式、timestamp为时间戳--可填参数。2、获取时间戳方法time()、strtotime()这两个方法,都可以获取php中unix时间戳,time()为直接获取得到,strtotime($time, $now)为将时间格式转为时间戳,$time为必填。清楚了这个,想了解更多,请继续往下看。3、 date($format)用法比如:echo date(' 阅读全文
posted @ 2012-07-16 15:41 Thinking In Code 阅读(377) 评论(0) 推荐(0) 编辑
摘要: 根据教程结合自己看法写的。红色为重点部分。1、在控制器中PHP代码$this->ajaxReturn('1','2',0);//说一下ajaxReturn的3个参数第一个是返回的数据变量,第二个是返回的信息,第三个是数据返回的状态。例如我们判断一个用户登录if($username==''||$userpass==''){$this->ajaxReturn('','用户名或密码不能为空!',0);}if($verify!=$_SESSION['verify']){$this 阅读全文
posted @ 2012-06-26 13:32 Thinking In Code 阅读(4946) 评论(0) 推荐(0) 编辑
摘要: test2.htm<html> <head> <title>巢状循环测试</title> </head> <body><{section name=sec1 loop=$row_array}> <table width="322" border="1" align="center" cellpadding="3" cellspacing="0"> <tr> <td colspan=& 阅读全文
posted @ 2012-06-18 16:35 Thinking In Code 阅读(1438) 评论(0) 推荐(0) 编辑
摘要: php 阅读全文
posted @ 2012-05-30 23:19 Thinking In Code 阅读(203) 评论(0) 推荐(0) 编辑
摘要: php静态 阅读全文
posted @ 2012-05-30 21:23 Thinking In Code 阅读(245) 评论(0) 推荐(0) 编辑
摘要: <?php//1.连接数据include "connect.php";/*-------------定义一个分页函数,主要用于生成分页按钮-----------------------------*/function page($pages,$cur_page,$base_url){/*参数说明: $pages : 总页面数 $cur_page: 当前第几页 $base_url: 当前的基本url例如 www.baidu.com/index.php?id=34&page=3 取 www.baidu.com/index.php?id=34返回值(String类型 阅读全文
posted @ 2012-05-30 13:42 Thinking In Code 阅读(282) 评论(0) 推荐(0) 编辑