2015-10-18 JS_事件、行为、结构分离 JS_事件、行为、结构分离 <!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>JS_事件、行为、结构分离</title> </head> <style type="text/css"> ul,li,div { margin: 0; padding: 0; ... 2015-10-18 日志 426 阅读 0 评论 2015年10月18日 426 阅读 0 评论
2015-10-18 抓不到乌龟 抓不到乌龟 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"><head><title>抓不到乌龟</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css"> div { width: 200px; &n... 2015-10-18 日志 379 阅读 0 评论 2015年10月18日 379 阅读 0 评论
2015-10-18 phpcms v9 如何在列表页和内容页调用子栏目的目录 phpcms v9 如何在列表页和内容页调用子栏目的目录 首先我们知道,每一个栏目都会有这样的三个文件,它们分别是栏目页category.html,列表页list.html,和内容页show.html 具体调用子栏目目录名的方法是: 在栏目首页(category.html)用下面的标签代码进行调用: {loop subcat($catid) $r}<a href="{$r[url]}" title="{$r[catname]}">{$r[catname]}</a>{/loop} 在列表页(list.html)和内容页(show.html)用下面的标签代码进行调用: {loop subcat($catid) $r}<a href="{$CATEGORYS[$r[catid]][url]}">{$CATEGORYS[$r[catid]][catname]}</a>{/loop} 注:上面的{loop subcat($catid) $r} 里面的$catid换上父栏目的ID号。 2015-10-18 日志 453 阅读 0 评论 2015年10月18日 453 阅读 0 评论
2015-10-18 PHP面向对象中对象链的使用操作 PHP面向对象中对象链的使用操作 / 对象链的使用操作class Xiao{public $name;public $sex; function __construct($name,$sex){$this->name=$name;$this->sex=$sex;}function say(){echo "我的名字叫{$this->name}<br/>";return $this;}function sex(){echo "我的性别是{$this->sex}<br/>";} }$jun=new Xiao('小明','20'); $jun->say()->sex(); 2015-10-18 日志 402 阅读 0 评论 2015年10月18日 402 阅读 0 评论
2015-10-18 PHP面向对象 __construct方法使用 PHP面向对象 __construct方法使用 // 构造方法,在new一个对象的时候,就会立刻自动调用__construct()这个函数class Humen{public $name;public $age; function __construct($name,$age){$this->name=$name;$this->age=$age;} function say(){echo "我叫{$this->name},我今年{$this->age}岁了!!<br/>";} }$a=new Humen('小红','44');$a->say();$b=new Humen('小明','18');$b->say(); 2015-10-18 日志 420 阅读 0 评论 2015年10月18日 420 阅读 0 评论
2015-10-18 php 对象方法变量 php 对象方法变量 // 类的方法传参,相当于$height就是局部变量,只能用在函数height里面class Xiao{function height($height){echo "身高是{$height}<br/>";} }$jun=new Xiao();$jun->height('165cm'); 2015-10-18 日志 468 阅读 0 评论 2015年10月18日 468 阅读 0 评论
2015-10-18 php ODP预处理机制笔记 php ODP预处理机制笔记 //php 预处理机制header('content-type:text/html;charset=utf-8');$pdo=new PDO("mysql:host=localhost;dbname=blong","root","root"); $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE,PDO::FETCH_ASSOC); $pdo->exec("set names utf8"); /* $sql="delete from v9_yuyue where id=?";$arr=arry(1,3,4,5);foreach($arr as $val){$obj=$pdo->prepare($sql);$obj->bindValue(1,$val);} */$sql2="insert into v9_yuyue(name,sex,age,content) v... 2015-10-18 日志 436 阅读 0 评论 2015年10月18日 436 阅读 0 评论
2015-10-18 JS获取浏览器和屏幕的宽高 JS获取浏览器和屏幕的宽高 //获取浏览器文档区的宽高var htmlw=document.documentElement.clientWidth;var htmlh=document.documentElement.clientHeight;//返回顶部代码window.onscroll=function(){var winScrollH=document.documentElement.scrollHeight;//总高度var winClientH=document.documentElement.clientHeight;//可视高度var winScrollTop=document.documentElement.scrollTop;//滚动高度 2015-10-18 日志 423 阅读 0 评论 2015年10月18日 423 阅读 0 评论
2015-10-18 JS检查客户端使用什么浏览器_笔记 JS检查客户端使用什么浏览器_笔记 <div> <button id="bid">检查浏览器</button> </div> <script type="text/javascript"> $id("bid").onclick=function(){ var wind=navigator.userAgent; &... 2015-10-18 日志 468 阅读 0 评论 2015年10月18日 468 阅读 0 评论
2015-10-18 linux nginx虚拟机主机,禁止某个IP配置 linux nginx虚拟机主机,禁止某个IP配置 把这段代码放到nginx安装目录配置文件nginx.conf,http{}中,不能放在默认server{}中,否则会报错,或服务失败,静止某个IP和某段IP也是放在自己的虚拟主机配置下server {listen 80;server_name www.php.com; #这个www.php.com是自己的域名index index.html index.htm index.php;root /home/free/nginx/www/www_php_com; #这个是这个域名所对应的安装目录 location ~ \.php$ { &nbs... 2015-10-18 日志 496 阅读 0 评论 2015年10月18日 496 阅读 0 评论