先用函数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);
Tags: ,
Posted in PHP at December 30th, 2009. 2 Comments.

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。

Tags: , ,
Posted in css at September 14th, 2009. No Comments.

当看到错误提示
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']}”;
?>
加上花括号{}可以让语句识别这里面是动态的。

Tags:
Posted in PHP at September 3rd, 2009. 1 Comment.

使用 Smarty 模板的时候,通常都是用 ‘{’ 和 ‘}’ 作为定界符(delimiter)。

有时,我们需要在 html 代码里输出大括号,如果在模板里直接写出来,会被 Smarty 的解析器认为是定界符,然后会报错:

Smarty error : syntax error: unrecognized tag

无法识别的标签!

如何解决呢?有 2 种办法:

1:内置变量

ldelim, rdelim
ldelim and rdelim are used for displaying the literal delimiter, in our case “{” or “}”. The template engine always tries to interpret delimiters, so this is the way around that.

ldelim 和 rdelim 用于输出分隔符,也就是大括号 ‘{’ 和 ‘}’。如果只是输出很少的几个大括号,请使用此方法。

2: 文本转义

我们经常会在 html 里写 javascript 函数,就不可避免地写大量的大括号,这个时候上面的解决方法就不适用了,Smarty 提供了一个转义一段代码的标签:{literal}…{/literal}

{literal}
<script type=”text/javascript”>
function sayHello() {alert(‘Hello World!’)}
</script>
{/literal}

这样,就可以在里面随意写各种符号,不必担心 Smarty 引擎会错误解析了!

Tags:
Posted in zf+smarty at March 26th, 2009. No Comments.
  1. /*
  2. 名称:PagingRecord
  3. 作用:按任意字段进行排序分页
  4. */
  5.  
  6. CREATE    PROCEDURE [dbo].[PagingRecord]
  7. (
  8. @PageIndex int,--页号,从0开始
  9. @PageSize int,--页尺寸
  10. @OrderField varchar(100),--排序字段及类型(多个条件用逗号分开)如:JobID DESC,Checkintime
  11. @TableName varchar(100),--表名或视图表
  12. @StrWhere varchar(2000),--条件
  13. @FieldList varchar(2000),--欲选择字段列表
  14. @DoCount  AS bit=1-- 0值返回记录总数, 非 0 值则返回记录
  15. )
  16. AS
  17.  
  18. BEGIN TRAN
  19.  
  20. DECLARE @SqlQuery varchar(4000)
  21.  
  22. IF @DoCount&lt;&gt;0
  23. Goto GetCount
  24. Else
  25. Goto GetSearch
  26.  
  27. GetCount:--返回记录总数
  28. DECLARE @SearchSql AS Nvarchar(4000)
  29. SET @SearchSql= 'SELECT Count(*) AS Total FROM <a href="mailto:%20+@TableName+%20">'+@TableName+'</a> WHERE <a href="mailto:%20+@StrWhere">'+@StrWhere</a>
  30. exec sp_executesql @SearchSql
  31. --print @SearchSql
  32. COMMIT TRAN
  33. return
  34.  
  35. GetSearch:
  36.  
  37. SET @SqlQuery='SELECT <a href="mailto:%20+@FieldList+%20">'+@FieldList+'</a>
  38. FROM (SELECT row_number() over(ORDER BY <a href="mailto:%20+@OrderField+%20">'+@OrderField+'</a>) as rownum,
  39. <a href="mailto:%20+@FieldList+%20">'+@FieldList+'</a>
  40. FROM <a href="mailto:%20+@TableName+%20">'+@TableName+'</a> WHERE <a href="mailto:%20+@StrWhere">'+@StrWhere</a> +') as temp
  41. WHERE rownum BETWEEN ('+cast(@PageIndex as varchar)+'-1)*'+cast(@PageSize as varchar)+'+1 and '+cast(@PageIndex
  42.  
  43. as varchar)+'*'+cast(@PageSize as varchar) + ' ORDER BY <a href="mailto:%20+@OrderField">'+@OrderField</a>
  44. --print @SqlQuery
  45. SET NOCOUNT ON
  46. execute(@SqlQuery)
  47. SET NOCOUNT OFF
  48. COMMIT TRAN
Tags:
Posted in mssql at March 11th, 2009. No Comments.

1.清空日志

1):打开查询分析器,输入命令
DUMP TRANSACTION 数据库名 WITH NO_LOG
2):再打开企业管理器–右键你要压缩的数据库–所有任务–收缩数据库–收缩文件–选择日志文件–在收缩方式里选择收缩至XXM,这里会给出一个允许收缩到的最小M数,直接输入这个数,确定就可以了。

2.删除LOG

1):分离数据库企业管理器->服务器->数据库->右键->分离数据库
2):删除LOG文件
3):附加数据库企业管理器->服务器->数据库->右键->附加数据库

此法生成新的LOG,大小只有500多K

3、如果想以后不让它增长

企业管理器->服务器->数据库->属性->事务日志->将文件增长限制为2M

再将此数据库设置自动收缩

Tags:
Posted in mssql at February 4th, 2009. No Comments.

最近项目中需要实现两台异地服务器图片同步,于是就开始查资料寻找合适的方法或者软件,其中在一篇文章中提到一个软件,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

不错不错,界面好,设置简单,功能强大,绝对的好东西啊!

Read More…

Posted in windows at December 3rd, 2008. 1 Comment.

这次修改的更新主要是增加了对保存目标路径的判断,如果不存在,就自动生成,SavePath的参数支持相对路径和绝对路径
uploadclass
下面把代码贴出来

‘———————————————————-
‘**************** 风声无组件上传类 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

Read More…

Tags: ,
Posted in ASP at December 1st, 2008. No Comments.
  1. /*
  2. Correctly handle PNG transparency in Win IE 5.5 &amp; 6.
  3. Copyright 2007 Ignia, LLC
  4. Based in part on code from from http://homepage.ntlworld.com/bobosola.
  5. Edit: Jena.want
  6. Date: 2008.11.30
  7. Web: www.AOBODO.com | www.IsHere.cn
  8.  
  9. Use in  with DEFER keyword wrapped in conditional comments:
  10. <!--[if lt IE 7]>
  11. <mce:script defer type="text/javascript" src="pngfix.js" mce_src="pngfix.js"></mce:script>
  12. <![endif]-->
  13. */
  14.  
  15. (function fixPng() {
  16. var arVersion = navigator.appVersion.split("MSIE")
  17. var version = parseFloat(arVersion[1])
  18.  
  19. if ((version &gt;= 5.5 &amp;&amp; version &lt; 7.0) &amp;&amp; (document.body.filters)) {
  20. for(var i=0; i
  21. var img = document.images[i];
  22. var imgName = img.src.toUpperCase();
  23. if (imgName.indexOf(".PNG") &gt; 0) {
  24. var width = img.width;
  25. var height = img.height;
  26. var sizingMethod = (img.className.toLowerCase().indexOf("scale") &gt;= 0)? "scale" : "image";
  27. img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + img.src.replace('%23', '%2523').replace("'", "%27") + "', sizingMethod='" + sizingMethod + "')";
  28. img.src = "images/blank.gif";
  29. img.width = width;
  30. img.height = height;
  31. }
  32. }
  33. }
  34. })();

这是打好包的文件,需要的朋友可以下载试试。msiepng

另外,如果PNG图片做背景的话,在IE6下也会出现不透明情况,以上脚本只解决了页面中的PNG图片透明,如果是CSS样式中使用了透明的PNG图片,则可以使用以下方案解决透明问题,利用了只有 IE6 才识别的下划线(_),来定义 IE6 浏览器中的滤镜:

  1. #png {
  2. background: url(绝对路径/images/bg.png) repeat;
  3. _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='scale', src="绝对路径/images/bg.png");
  4. _background:none;
  5. }
Tags: , ,
Posted in javascript at November 30th, 2008. 1 Comment.
buy.maimaij.com

buy.maimaij.com

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

Tags:
Posted in 买卖街 at November 21st, 2008. No Comments.
Pages: Prev 1 2 3 4 5 6 7 8 9 10 ...17 18 19 Next