摘要: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <title> new document </title> <meta name="generator" con 阅读全文
posted @ 2012-06-25 14:16 绒花雪冷 阅读(802) 评论(0) 推荐(0) 编辑
摘要: function inArray(needle,array,bool){ if(typeof needle=="string"||typeof needle=="number"){ for(var i in array){ if(needle===array[i]){ if(bool){ return i; } return true; } } retur... 阅读全文
posted @ 2012-06-25 14:14 绒花雪冷 阅读(1182) 评论(0) 推荐(0) 编辑
摘要: /** * 获得当前访问的MVC * @param Zend_Controller_Front $ctlFront * @return array(module, controller, action) * * @example * list($module, $controller, $action) = getMVC(); */ public static function getMVC($ctlFront = null) { if ($ctlFront == null) { $ctlFr... 阅读全文
posted @ 2012-06-22 12:39 绒花雪冷 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 获得返回行数1 $objSelect = $db->select()->from(array('u'=>'cmb_user'),array('COUNT(1)'))2 ->where('u.account = ?',$account);3 $num = $db->fetchOne($objSelect,null,Zend_Db::FETCH_OBJ);返回插入的ID1 $db->lastInsertId(); 阅读全文
posted @ 2012-06-12 22:34 绒花雪冷 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 不使用view1$this->_helper->viewRenderer->setNoRender();Ajax相关 1 class AjaxRes 2 { 3 const STATUS_SUCCESS = 0; 4 const STATUS_ERROR = 1; 5 private $_arrRes; 6 function __construct(){ 7 $this->_arrRes = array('status'=>self::STATUS_SUCCESS,'statusinfo'=>'操作成功'); 阅读全文
posted @ 2012-06-12 22:31 绒花雪冷 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1 function isEmail(str){ 2 var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/; 3 return reg.test(str); 4 } 5 6 1:js 字符串长度限制、判断字符长度 、js限制输入、限制不能输入、textarea 长度限制 7 8 <script> 9 10 function test() 11 12 { 13 14 if(document.a.b.value.length>50) 15 16 { 17 18 alert("... 阅读全文
posted @ 2012-06-12 15:14 绒花雪冷 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 html> 2 <head> 3 <title>中国站长天空-网页特效-表单特效-给文本框添加灰色提示文字</title> 4 <meta http-equiv="content-Type" content="text/html;charset=gb2312"> 5 </head> 6 <body> 7 <!--把下面代码加到<body>与</body>之间--> 8 <input type="text" id= 阅读全文
posted @ 2012-06-12 07:31 绒花雪冷 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 1 <?php 2 Class DB { 3 private $link_id; 4 private $handle; 5 private $is_log; 6 private $time; 7 //构造函数 8 public function __construct() { 9 $this->time = $this->microtime_float(); 10 require_once("config.db.php"); 11 $this->connect($db_confi... 阅读全文
posted @ 2012-06-11 22:37 绒花雪冷 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * 给Zend_Db_Select增加where条件 3 * 4 * @param Zend_Db_Select $select 5 * @param array $where 6 * @return Zend_Db_Select 7 */ 8 protected function addWhereToSelect($select, $where) { 9 foreach ($where as $k=>$v) {10 if ($v === null) {11 ... 阅读全文
posted @ 2012-06-11 22:21 绒花雪冷 阅读(681) 评论(0) 推荐(0) 编辑