先用函数base64_encode() — 使用 MIME base64 对数据进行编码
标题字符串前加编码类型例如: =?UTF-8?B?
标题字符串后加:?=
邮件header指明Content-type: text/html; charset=utf-8,这样就能防止邮件正文乱码
$to = ‘zhoz@example.com’;
$subject = “=?UTF-8?B?”.base64_encode(‘邮件标题’).”?=”;
$headers = ‘MIME-Version: 1.0′ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=utf-8′ . “\r\n”;
// Additional headers
$headers .= ‘To: zhoz <zhoz@example.com>’ . “\r\n”;
$headers .= ‘From: Admin <admin@example.com>’ . “\r\n”;
$headers .= ‘Reply-To: zhoz <zhoz@example>’ . “\r\n”;
mail($to, $subject, $message, $headers);
Posted in PHP
|
Tagged email, PHP
|
IE里需要在 a 标签中加入 hidefocus=”true” 属性:<a href=”” hidefocus=”true” title=””>siteface</a>
而在Firefox等浏览器中定义CSS:a { outline:none; }或者a { outline:0; } 就可以了。
在IE里 hideFocus即隐藏聚焦,具有使对象聚焦失效的功能,其功能相当于:
onFocus=”this.blur()”
它的值是一个布尔值,如hideFocus=true。也可省略赋值直接写hideFocus。
Posted in IE, css
|
Tagged firefox, focus, IE
|
当看到错误提示
syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
这个提示,是提示变量使用的问题。
而我出现的是,语句中使用了数组,导致失败。下面看看失败的代码;
<?php
echo “我是数组,$n['x']“;
?>
这样即时双引号是可以解析变量的,但是素组这样的,写法是没办法解析。修改成下面就可以了!
<?php
echo “我是数组,{$n['x']}”;
?>
加上花括号{}可以让语句识别这里面是动态的。
Posted in PHP
|
Tagged PHP
|
最近项目中需要实现两台异地服务器图片同步,于是就开始查资料寻找合适的方法或者软件,其中在一篇文章中提到一个软件,WebSynchronizer,介绍是这样的:
档案同步化工具 – WebSynchronizer,由知名续传软件 ReGet 之软件出版公司所推出,是网站同步化、档案镜像、档案备份的绝佳工具,可以执行下列主要工作:
1) 本机资料夹及远程资料夹的同步化;
2) 两台远程计算机中的资料夹同步化;
3) 两个本机资料之同步化。
看介绍正好符合我的需求,于是便搜索这个软件,在BAIDU上搜索的都是1.3版本的,而且非开源软件,这个可愁了,现在不可能花钱去购买软件的,只能再找, 看看有没有破解版本的,结果中文搜索结果都没有破解的,于是又转向GOOGLE,结果不经意之间发现了WebSynchronizer1.5版,而且还有开源代码,难道是免费的?我赶紧下载下来,安装,一路下来也没有提示要输入序列号,就这样安装好了,真是喜出望外,后来看了一下更新日志,原来到1.5版本这个项目转成开源的了:
Current version: WebSynchronizer 1.5 (build 162)
Build 162 / 09 Jan
WebSynchronizer moved to open source
不错不错,界面好,设置简单,功能强大,绝对的好东西啊!
Continue reading →
这次修改的更新主要是增加了对保存目标路径的判断,如果不存在,就自动生成,SavePath的参数支持相对路径和绝对路径
uploadclass
下面把代码贴出来
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| '----------------------------------------------------------
'**************** 风声无组件上传类 2.11 *****************
'作者:风声
'网站:http://www.fonshen.com
'邮件:webmaster@fonshen.com
'版权:版权全体,源代码公开,各种用途均可免费使用
'修改:迦楠
'网站:http://www.ishere.cn | http://www.aobodo.com
'说明:SavePath参数支持相对与绝对两种路径,并自动生成目标文件夹
'**********************************************************
'----------------------------------------------------------
Class UpLoadClass
Private m_TotalSize,m_MaxSize,m_FileType,m_SavePath,m_AutoSave,m_Error,m_Charset
Private m_dicForm,m_binForm,m_binItem,m_strDate,m_lngTime
Private m_Fso,astrPath, ulngPath, i, strTmpPath
Public FormItem,FileItem
Public Property Get Version
Version="Fonshen UpLoadClass Version 2.11"
End Property
<a href="http://ishere.cn/2008/12/01/%e9%a3%8e%e5%a3%b0%e6%97%a0%e7%bb%84%e4%bb%b6%e4%b8%8a%e4%bc%a0%e7%b1%bb%e4%bf%ae%e6%94%b9%e7%89%88.html#more-463" class="more-link">Continue reading <span class="meta-nav">→</span></a> |
Posted in ASP
|
Tagged ASP, asp upload
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| /*
Correctly handle PNG transparency in Win IE 5.5 & 6.
Copyright 2007 Ignia, LLC
Based in part on code from from http://homepage.ntlworld.com/bobosola.
Edit: Jena.want
Date: 2008.11.30
Web: www.AOBODO.com | www.IsHere.cn
Use in with DEFER keyword wrapped in conditional comments:
<!--[if lt IE 7]>
<mce:script defer type="text/javascript" src="pngfix.js" mce_src="pngfix.js"></mce:script>
<![endif]-->
*/
(function fixPng() {
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5 && version < 7.0) && (document.body.filters)) {
for(var i=0; i
var img = document.images[i];
var imgName = img.src.toUpperCase();
if (imgName.indexOf(".PNG") > 0) {
var width = img.width;
var height = img.height;
var sizingMethod = (img.className.toLowerCase().indexOf("scale") >= 0)? "scale" : "image";
img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src.replace('%23', '%2523').replace("'", "%27") + "', sizingMethod='" + sizingMethod + "')";
img.src = "images/blank.gif";
img.width = width;
img.height = height;
}
}
}
})(); |
这是打好包的文件,需要的朋友可以下载试试。msiepng
另外,如果PNG图片做背景的话,在IE6下也会出现不透明情况,以上脚本只解决了页面中的PNG图片透明,如果是CSS样式中使用了透明的PNG图片,则可以使用以下方案解决:
1 2 3 4 5
| #png {
background: url(绝对路径/images/bg.png) repeat;
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='scale', src="绝对路径/images/bg.png");
_background:none;
} |
Posted in IE, css, javascript
|
Tagged ie6, js, png
|

Buy.MaiMaiJ.com is a professional wholesale website in China, dedicating itself to build a worldwide wholesale shop online.
Our site is aiming to operate the B-to-C transactions with consumers from all over the world. The biggest superiority of our site is applying the system MaiMaiJ (http://www.MaiMaiJ.com), It can provide global sellers and buyers with easier methods for processing and managing wholesale orders.
Our slogan is “Buy Wholesale Products from Chinese Wholesaler”, using Buy.MaiMaiJ.com, the buyers can submit orders online and the sellers manage orders easily, without handwork, Emails and Faxes.
You can get what you like on this website at wholesale prices. We sell a vast range of merchandise produced exclusively by Chinese manufacturers. If you like to hunt for something special at low price by fashionable online shopping, then use Buy.MaiMaiJ.com to purchase various kinds products you are interested in.
http://buy.maimaij.com/links.html
http://buy.maimaij.com/links-add.html
Posted in 买卖街
|
Tagged maimaij.com
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <!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" />
</head>
<body>
<script type="text/javascript">
/*
* author:Jena.want
* web:www.AOBODO.com
* last edit:2008.11.11
* 谨以此送给正在享受光棍节的哥们们!祝今年节日快乐!祝明年不再过此节!
*/
//<![data[
checkInstalled = function(m) {
switch(m){
case 'msn':
try {
new ActiveXObject("MSNMessenger.P4QuickLaunch");
return true;
}
catch (e) {
return false;
}
case 'skype':
try{
new ActiveXObject("Skype.Detection");
return true;
}catch(e){
return false;
}
case 'qq':
try {
new ActiveXObject("TimwpDll.TimwpCheck");
return true;
}
catch (e) {
return false;
}
}
} //]]-->
</script>
<input type="button" value="检测有没有安装MSN" onclick="alert(checkInstalled('msn'))" />
<input type="button" value="检测有没有安装QQ" onclick="alert(checkInstalled('qq'))" />
<input type="button" value="检测有没有安装SKYPE" onclick="alert(checkInstalled('skype'))" />
</body>
</html> |
测试环境:WIN SERVER 2008,IE6+,Firefox2.0+,Opera,Chorme
Posted in javascript
|
Tagged js, MSN, QQ, Skype
|
PclZip介绍
PclZip library能够压缩与解压缩Zip格式的压缩档(WinZip、PKZIP);且能对此类类档案进行处理,包括产生压缩档、列出压缩档的内容以及解压缩档案等等。由于能够在伺服器端进行压缩与解压缩的动作,所以相当方便使用。
PclZip定义一个PclZip类别,其类别物件可视为一个ZIP档案,亦提供method来进行处理。
如何使用PclZip
1.基础
所有的功能都由pclzip.lib.php这个档案提供,PclZip library可于其首页(www.phpconcept.net/pclzip/index.en.php)下载,(PS:但是目前打不开了,我上传了一个文件class-pclzip)。所有的PKZIP档案其实就是一个 PclZip的类别物件。当产生一个PclZip档案(ie, PclZip类别物件),就会先产生一个压缩档,且档名已经指定,但此压缩档的内容尚未存在:
< ?PHP
require_once('pclzip.lib.php');
$archive = new PclZip("archive.zip");
?>
此物件提供了一些public method可用来处理此档案。
Continue reading →
以前的程序是把图片通过ASP以二进制的格式存储到MSSQLSERVER中的,现在需要用PHP把它显示出来,
$id = $_GET['id'];
$conn = dbo_connect();
$query = “select f.Data from Files f,Products p where p.PhotoSN=f.SN and p.ID=$id”;
$result = mssql_query($query, $conn);
if (mssql_num_rows($result)) {
$row = mssql_fetch_assoc($result);
if (!empty($row['Data'])) {
echo $row['Data'];
}
}
mssql_close($conn);
但是读取出来的图片都只有开头一小部分,其它部分是空白,全选以后看到的图片大小似乎也是正常的,就是有一部分显示不出来,好一个纳闷。质量高的图片显示的部分还要小,质量低的或者图片尺寸小的就要显示的多一些,看样子是读取的数据大小是一致的。后来一看$row['Data']的长度,果然清一色的4096,原来如此。
上网查资料,费了好大劲,才看到一句有价值的话“是配置错了”。配置错了?难道PHP读取MSSQL的image数据还有大小限制?赶紧打开php.ini,搜索image,没有相关的,搜索4096,还没有相关的,不会吧?!哈哈,原来是已经搜索到文件末尾,还在向下搜索,难怪没有。赶紧改方向,找到了!但是无关,再搜,OK,终于找到了:
; Valid range 0 – 2147483647. Default = 4096.
;mssql.textlimit = 4096
; Valid range 0 – 2147483647. Default = 4096.
;mssql.textsize = 4096
原来如此,把mssql.textlimit和mssql.textsize后面的值都改成最大,2147483647,然后再把前面的分号去掉,保存,重启IIS。再去看刚才的程序显示出来的图片,成了,全部显示!
真亲啊!GOOD!
这年头估计用VB6做开发的人已经不多了吧。公司有个项目,需要用到VB6,每次都为在编辑器里不能滑动滚轮而烦恼,实在是不方便啊,也难怪,有点年头了。今天在网上找资料,碰巧看到一篇文章就是解决这个问题的,呵呵,太好了。操作步骤如下:
1、下载http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe,这是一个自解压的包,其中包含VB6IDEMouseWheelAddin.dll和其源程序,或者在附件里下载,我已经上传了,vb6idemousewheeladdin-dll。
2、将包中的VB6IDEMouseWheelAddin.dll或者将源程序编译出一个新的VB6IDEMouseWheelAddin.dll COPY到系统目录或者VB安装目录(防止被删除)。
3、运行regsvr32 <path>\VB6IDEMouseWheelAddin.dll,注册这个dll。
4、运行Visual Basic 6.0。
5、单击“外接程序”菜单下的“外接程序管理器”,弹出“外接程序管理器”对话框。
6、在“可用外接程”序列表中,选择“MouseWheel Fix”,在加载行为栏中单击选中“加载/卸载和在启动中加载”复选框。
7、确定,完成。
这时,你的Visual Basic6.0 IDE已经支持滚轮了
Posted in keyboard's joy
|
Tagged VB6, VB6滚轮
|
mssql默认以系统时间格式输出,你可以调整系统的时间格式来解决
当然是在程序里解决比较灵活,例如:
“select convert(char,日期字段,120) as date2 from table”
convert(char,date,N)输出的各中样式
N 日期样式
0 04 2 2005 9:06AM
1 04/02/05
2 05.04.02
3 02/04/05
4 02.04.05
Continue reading →
代码如下:
<script type=”text/javascript”>
loadURL = function(){
location.href = “http://www.aobodo.com”;
}
</script>
<a href=”javascript:void(0);” onclick=”javascript:loadURL();”>Link1</a>
<a href=”#” onclick=”javascript:loadURL();”>Link2</a>
<a href=”javascript:loadURL();”>Link3</a>
以上三种方式在IE7+,Firefox下可以正常执行,第一种方式在IE6-没有响应。
第一种方式要想在IE6-下正常执行,需要修改成<a href=”javascript:void(0);” onclick=”javascript:loadURL();return false”>Link1</a>。
Posted in IE, javascript
|
买卖街本着“用户至上”的服务原则,从用户的实际需要出发,增加了更多人性化的贴心服务。为了方便您更加流畅地使用买卖街,也为了买卖街能更好地为您服务,我们特设立了QQ讨论群,实现了我们与您的实时交流,解答您在使用过程中遇到的问题,听取您对买卖街的意见和建议;同时您还可以与其他用户交流使用买卖街的心得。
加入QQ 讨论群,畅所欲言买卖街!让我们了解您的心声,您的需求就是我们的追求!
群号:55200511
Posted in keyboard's joy
|
Tagged CoolCode
|
HMailServer is a free, GNU GPL licensed email server for Windows. It runs as a service with a management tool that connects to allow configuration of settings similar to the way Exchange works. It has support for the IMAP, POP3, and SMTP open email standard protocols, and stores index data in MySQL or MS SQL but the actual e-mail content is still stored as files in a format similar to Maildir (the contents are the same but the directory structure is different). It is updated frequently and has active support and development forums.
All common features such as multiple-domain support, aliases (catch-all and specific ones for addresses and also for domains themselves) and basic mailing lists are present. Users can be authenticated against both the local system and other servers, including domain controllers.
It offers a variety of anti-spam options such as:-
- Host based DNS Blacklisting (DNSBL)
- URL based DNS blacklisting (SURBL)
- Greylisting (must retry sending for the message to succeed)
And provides basic support for using JScript or VBScript to modify the behaviour of the server on receipt of messages and at a variety of other events (including client connection).
HMailServer in current versions does not include SSL or TLS support, however this can be easily added using a third party application called STunnel which uses the OpenSSL libraries to add secure connection support. IPv6 support can also be added using STunnel, it is not included.
There is recent discussion that further releases of the software will not be open source visible on the forums by the developer.
Some features that may be of interest to businesses but are commonly missing in other servers are also available and easy to configure, such as:-
- Compulsory signatures (for legal and advertising footers)
- Server side rules
- External account retrieval
- Quotas on domain, mailbox, and individual message sizes
- Plus addressing (using + to make a virtual alias for an account specific to a task, as seen in Gmail)
- Attachment blocking
- E-Mail mirroring (all messages sent to a particular address)
- Custom SMTP routes for specific domains
Integration is supported for many related applications, including:-
- SquirrelMail for webmail, (requires IIS or Apache); spell-checking available
- ClamAV anti-virus software
- SpamAssassin spam filtering
- and more…
在Javascript里计算小数乘法,容易出现浮点错误,例如:
1 2 3 4 5
| <script>
document.write (1.1*1.3);
document.write ("<br>");
document.write (1.2*1.1);
</script> |
输出结果:
1 2
| 1.4300000000000001
1.32 |
解决问题的思路就是,先把因数放大为整数,最后再除以相应的倍数,这样就能得到正确的结果了。解决办法如下:
1、 在算式中解决
1 2 3
| <script>
alert(1.1*(1.3*10)/10);
</script> |
2、添加到Number的原型方法里
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <script>
Number.prototype.rate=function(){
var oStr=this.toString();
if(oStr.indexOf(".")==-1)
return 1;
else
return Math.pow(10,parseInt(oStr.length-oStr.indexOf(".")-1));
}
function tran(){
args=tran.arguments;
var temp=1;
for(i=0;i < args.length;i++)
temp*=args[ i ]*args[ i ].rate();
for(i=0;i < args.length;i++)
temp/=args[ i ].rate();
return temp;
}
</script> |
使用方法:假如11*22.9,可以这样写tran(11,22.9),这样,问题就解决了。