.HTACCESS 屏蔽IP

June 11th, 2010 No comments »
1
2
3
4
5

order deny,allow          <-- 注意这里的写法
allow from 174.7.174.77    <-- 这里输入自己的IP或IP段
allow from 174.7.0.0/16    <-- 这里输入自己的IP或IP段
deny from 58.14.0.0/15
deny from 58.16.0.0/16
.....
1
2
    order allow , deny 只要deny的IP就不能访问,不管是否allow了
    order deny, allow  只要allow的IP就可以访问,不管是否deny了

介绍下 IP 段的写法:
allow from 174.7.0.0/16 的意思就是允许 174.7.0.0 – 174.7.255.255 IP 段的访问,而这个 174.7.0.0/16 IP段是 CIDR 的形式。

注:CIDR 形式该怎么理解呢?
其实很简单,把我们常见的那种 IP 转换成二进制的32位形式,那么 CIDR 写法中”/16 就是把其中的前16位固定不变,而后面的16位数,每八位一组,可以改变。所以就有了上面的范围。
再举个例子, 192.168.88.12/31 ,后面只有一位可以改变,那么这个 IP 范围就是:192.168.88.12 – 192.168.88.13 。

http://wenku.baidu.com/view/f9d856fe04a1b0717fd5dd31.html

控制zen cart 首页,产品页布局

June 5th, 2010 3 comments »

打开tpl_main_page.php编辑:

例子:

原程序例子:
//如果COLUMN_LEFT_STATUS 等于 0 或 CUSTOMERS_APPROVAL 等于1 与 客户IP是空 就把 $flag_disable_left 设成 true
if (COLUMN_LEFT_STATUS == 0 or (CUSTOMERS_APPROVAL == ’1′ and $_SESSION['customer_id'] == ”)) {
// global disable of column_left
$flag_disable_left = true;
}

参照例子:
// 如果页面是page_2页 就把$flag_disable_left 设成 true
//打开page_2页时关闭左栏
if ($_GET['main_page'] == ‘page_2′) {
$flag_disable_left = true;
}

// 如果页面是product_info页 就把$flag_disable_right 设成 true
//打开产品信息页时关闭右栏
if ($_GET['main_page'] == ‘product_info’) {
$flag_disable_right = true;
}

依次类推 很简单就可以实现随意栏目的设置了

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER

June 2nd, 2010 No comments »

第三种方法:网上看到的,先记录一下。

1.如果安装mysql的编码已不能更改,很多朋友是购买虚拟主机建立网站,无权更改MYSQL的安装编码,这一关我们可以跳过,因为只要后面的步聚正确,一样能解决乱码问题
2.修改数据库编码,如果是数据库编码不正确: 可以在phpmyadmin 执行如下命令: ALTER DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin
以上命令就是将test数据库的编码设为utf8
3.修改表的编码:ALTER TABLE `category` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin
以上命令就是将一个表category的编码改为utf8
4.修改字段的编码:
ALTER TABLE `test` CHANGE `dd` `dd` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL
以上命令就是将test表中 dd的字段编码改为utf8
5.如果是这种情况容易解决,只需检查下页面,修改源文件的charset即可
, //这个正确就无问题了
6.这种情况也是修改页面charset即可

参考:http://hi.baidu.com/yuanli_whu/blog/item/ec70cf22af8f5e4cac34de60.html

http://hi.baidu.com/pizza/blog/item/95a23a87b477692ac65cc31d.html

http://hi.baidu.com/hhytr/blog/item/e74da2be7d987f0219d81f5c.html

http://blog.jjgod.org/2005/07/31/a-mysql-41-story/#more-51

解决:

在.SQL语句顶部加SET NAMES ‘UTF8′;

重新在phpmyadmin中执行.

Database server does not support InnoDB storage engine

May 14th, 2010 No comments »

Windows xp . PHPNOW.

提示如标题所示:

选择: MySQL-5.0.77或者MySQL-5.0.89或者MySQL-XXX文件夹下.my-innodb-heavy-4G.ini 和 my.ini 和 my-huge.ini

查找 skip-bdbskip-bdb , skip-innodb 删除. 重启.

Database server does not support InnoDB storage engine

May 13th, 2010 No comments »

innodb_data_file_path

edit /etc/my.cnf configuration file and restart MySQL service for enabling InnoDB.

Delete

skip-bdb
skip-innodb

skip-bdbskip-innodb

Restart MYSQL

http://dev.mysql.com/doc/refman/5.0/en/innodb.html

如何横向排列DIV+CSS

May 8th, 2010 No comments »

<code>

<!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>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>无标题文档</title>
<link href=”css.css” rel=”stylesheet” type=”text/css” media=”all” />
</head>
<style type=”text/css”>
@charset “utf-8″;
/* CSS Document */
body{
padding:0;
margin:0;
font-family:Arial, Helvetica, sans-serif;
background:url(images/main_bg.gif) 0 0 repeat-x #fff;
color:#5E5E5E;
}
div, h1, h2, h3, h4, p, form, label, input, textarea, img, span{
margin:0; padding:0;
}
ul{
margin:0;
padding:0;
list-style-type:none;
font-size:0;
line-height:0;
}
.spacer{
clear:both;
font-size:0;
line-height:0;
}
/*————————————————main——————–*/
#body{
width:918px;
margin:0 auto;
}
/*————————————————top——————-*/
#top{
width:903px;
height:23px;
background:url(images/top_nav_bg.gif) 0 0 repeat-x;
padding:8px 15px 0 0;
}
#top ul{
float:left;
width:815px;
}
#top ul li{
float:left;
font-size:0;
line-height:0;
}
#top ul li a{
display:block;
padding:0 14px;
font:bold 11px/23px Arial, Helvetica, sans-serif;
color:#6C6C6C;
background-color:inherit;
text-decoration:none;
}
#top ul li a:hover{
color:#fff;
background-color:#BD0000;
}
#top ul li a.hover{
display:block;
padding:0 14px;
font:bold 11px/23px Arial, Helvetica, sans-serif;
color:#fff;
background-color:#BD0000;
text-decoration:none;
cursor:text;
}
#top p{
float:right;
padding:2px 0 0 12px;
background:url(images/phone_icon.gif) 0 2px no-repeat;
font:bold 11px/16px Arial, Helvetica, sans-serif;
color:#C89601;
background-color:inherit;
}
/*————————————————top——————–*/
</style>
<body>
<div id=”top”>
<ul>
<li><a href=”#”>Home</a></li>
<li><a href=”#”>About us</a></li>
<li><a href=”#”>Support</a></li>
<li><a href=”#”>Solutions </a></li>
<li><a href=”#”>Targets</a></li>
<li><a href=”#”>Signup</a></li>
<li><a href=”#”>Meetings</a></li>
<li><a href=”#”>News</a></li>
<li><a href=”#”>Blog</a></li>
<li><a href=”#”>Contact</a></li>
</ul>
<p>+01-4445-6678</p>
</div>
</body>
</html>

<!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><meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /><title>无标题文档</title><link href=”css.css” rel=”stylesheet” type=”text/css” media=”all” /></head><style type=”text/css”>@charset “utf-8″;/* CSS Document */body{ padding:0; margin:0; font-family:Arial, Helvetica, sans-serif; background:url(images/main_bg.gif) 0 0 repeat-x #fff; color:#5E5E5E;}div, h1, h2, h3, h4, p, form, label, input, textarea, img, span{ margin:0; padding:0;}ul{ margin:0;  padding:0;  list-style-type:none; font-size:0; line-height:0;}.spacer{ clear:both;  font-size:0;  line-height:0;}/*————————————————main——————–*/#body{ width:918px; margin:0 auto;}/*————————————————top——————-*/#top{ width:903px; height:23px; background:url(images/top_nav_bg.gif) 0 0 repeat-x; padding:8px 15px 0 0;}#top ul{ float:left; width:815px;}#top ul li{ float:left; font-size:0; line-height:0;}#top ul li a{ display:block; padding:0 14px; font:bold 11px/23px Arial, Helvetica, sans-serif; color:#6C6C6C; background-color:inherit; text-decoration:none;}#top ul li a:hover{ color:#fff; background-color:#BD0000;}#top ul li a.hover{ display:block; padding:0 14px; font:bold 11px/23px Arial, Helvetica, sans-serif; color:#fff; background-color:#BD0000; text-decoration:none; cursor:text;}#top p{ float:right; padding:2px 0 0 12px; background:url(images/phone_icon.gif) 0 2px no-repeat; font:bold 11px/16px Arial, Helvetica, sans-serif; color:#C89601; background-color:inherit;}/*————————————————top——————–*/</style><body><div id=”top”>            <ul>               <li><a href=”#”>Home</a></li>                    <li><a href=”#”>About us</a></li>                    <li><a href=”#”>Support</a></li>                    <li><a href=”#”>Solutions </a></li>                    <li><a href=”#”>Targets</a></li>                    <li><a href=”#”>Signup</a></li>                    <li><a href=”#”>Meetings</a></li>                    <li><a href=”#”>News</a></li>                    <li><a href=”#”>Blog</a></li>                    <li><a href=”#”>Contact</a></li>              </ul>                <p>+01-4445-6678</p>            </div></body></html>

</code>

第一与第九. 记录下

May 8th, 2010 No comments »

VIP. 105987

crazy 47361 – 150522

IETester-网页设计师利器の一

May 6th, 2010 No comments »

在设计网页的时候,不得不考虑浏览器兼容问题,就IE在市场上就有好几个版本在使用,而每个版本对CSS的解析方式都会有些许的差别,要做到兼容各 种主流浏览器,我们首先要做的当然是安装各种不同的浏览器,虽然市场上的浏览器品牌很多,但只要能兼容下面四种浏览器,那么你的网页就没有问题了。

IE6\IE7\firefox\safari

现在问题来了,在同一台电脑上,如果安装IE7,会卸掉IE6,而且对于像我这种网吧用户来说,根本无法安装,因为安装后需要重启电脑,而重启电脑 后网吧的还原系统会把系统还原。

而install-ietester 这个软件,包含IE5.5、IE6、IE7、IE8,能够满足测试的需要了

官方网站

http://www.my-debugbar.com/wiki/IETester/HomePage

Download IETester v0.4.3 (http://www.my-debugbar.com/ietester/install-ietester-v0.4.3.exe) 25MB

Excel2007中如何一次选中多个图表或图形对象?

May 5th, 2010 No comments »

Q:Excel2007中如何一次选中多个图表或图形对象?
A:单击“开始”选项卡中的“查找和选择”下拉菜单->勾选“选择对象”菜单项,鼠标指针变为一个空心键形,然后再用其在工作表中框取一个包含图形对象的范围,即可选中多个对象。操作完成后,应取消勾选“选择对象”菜单项,让鼠标指针恢复回正常状态。

也可按住Ctrl或Shift键,再用鼠标逐一选取多个对象。

如果需要选中工作表中的所有对象,单击“开始”选项卡中“查找和选择”下拉菜单-〉定位条件(或快捷键Ctrl+G),调出“定位条件”对话框,单击“对象”选钮,再单击“确定”按钮,即一次选中工作表中的所有对象。

——————————–

选择一个图片.Ctrl+A. 然后-格式->对齐->对齐网格

正则表达式 完全匹配

April 30th, 2010 No comments »
用^开头$结为就可以,比如要完全匹配ABC的正则表达式是:
/^ABC$/