<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Jason's blog</title>
	<atom:link href="http://blog.asdjkl.net/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.asdjkl.net</link>
	<description>a php new student</description>
	<pubDate>Fri, 12 Sep 2008 03:48:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>php 伪ajax 上传文件 实现无刷新上传文件</title>
		<link>http://blog.asdjkl.net/archives/27</link>
		<comments>http://blog.asdjkl.net/archives/27#comments</comments>
		<pubDate>Fri, 12 Sep 2008 03:47:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<category><![CDATA[ajax 无刷新]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=27</guid>
		<description><![CDATA[发现一个php 伪ajax 上传文件示例，写得比较拖沓，我只把其中有用的部分提取出来，实现无刷新上传文件
 先看代码如下:

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
&#60;?php
&#160;
$upload_dir = 'savedir';  //文件存储的路径
&#160;
&#160;
//处理上传的文件
if &#40;isset&#40;$_POST&#91;'fileframe'&#93;&#41;&#41;
&#123;
	$result='ERROR';
	$result_msg = 'No FILE field found';
	if&#40;isset&#40;$_FILES&#91;'file'&#93;&#41;&#41;
	&#123;
		if &#40;$_FILES&#91;'file'&#93;&#91;'error'&#93; == UPLOAD_ERR_OK&#41;
&#123;$filename = $_FILES&#91;'file'&#93;&#91;'name'&#93;;
move_uploaded_file&#40;$_FILES&#91;'file'&#93;&#91;'tmp_name'&#93;, $upload_dir.'/'.$filename&#41;; 
$result = 'OK';
&#125;
elseif &#40;$_FILES&#91;'file'&#93;&#91;'error'&#93; == UPLOAD_ERR_INI_SIZE&#41;
$result_msg = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
else 
$result_msg = 'Unknown error';
	&#125;
&#160;
echo '&#60;html&#62;&#60;head&#62;&#60;title&#62;-&#60;/title&#62;&#60;/head&#62;&#60;body&#62;';
echo '&#60;script language=&#34;JavaScript&#34; type=&#34;text/javascript&#34;&#62;'.&#34;\n&#34;;
echo 'var parDoc = window.parent.document;';
&#160;
if &#40;$result == 'OK'&#41;
&#123;
 echo 'parDoc.getElementById(&#34;upload_status&#34;).innerHTML = &#34;文件[ '.$filename.' [...]]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/27/feed</wfw:commentRss>
		</item>
		<item>
		<title>php 在线编辑器-一个从Ucenter home中剥离的在线编辑器</title>
		<link>http://blog.asdjkl.net/archives/24</link>
		<comments>http://blog.asdjkl.net/archives/24#comments</comments>
		<pubDate>Tue, 12 Aug 2008 02:41:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<category><![CDATA[php在线编辑器]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=24</guid>
		<description><![CDATA[我其实和很多人一样一直在找一个简单可用用的php在线编辑器，其实没有必要提供很强悍的功能，一般是图片，swf，链接，也就够了。
    在研究uch的过程中感觉它的在线编辑器还是不错的，而且调用还是挺间的。
    看了一下，我觉得包含这样这份文件，你就可以用这个php在线编辑器了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
//先说如何使用
&#60;form id=&#34;postform&#34; name=&#34;postform&#34; method=&#34;post&#34; action=&#34;test.php&#34;&#62;
 &#60;textarea class=&#34;userData&#34; name=&#34;message&#34; id=&#34;uchome-ttHtmlEditor&#34; style=&#34;height:100%;width:100%;display:none;border:0px&#34;&#62;&#60;/textarea&#62;
  &#60;iframe src=&#34;editor.php?charset=utf-8&#38;allowhtml=1&#34; name=&#34;uchome-ifrHtmlEditor&#34; id=&#34;uchome-ifrHtmlEditor&#34; scrolling=&#34;no&#34; border=&#34;0&#34; frameborder=&#34;0&#34; style=&#34;width:100%;border: 1px solid #C5C5C5;&#34; height=&#34;200&#34;&#62;&#60;/iframe&#62;
  &#60;input type=&#34;hidden&#34; name=&#34;confirmgo&#34; value=&#34;go&#34; /&#62;
  &#60;input type=&#34;submit&#34; name=&#34;posteditsubmit_btn&#34; id=&#34;posteditsubmit_btn&#34; onclick=&#34;edit_save();&#34; value=&#34;提交&#34; class=&#34;submit&#34; /&#62;&#38;nbsp;
  &#60;/form&#62;
  &#60;?php
  if &#40;$_POST&#91;'confirmgo'&#93;=='go'&#41; &#123;
  [...]]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/24/feed</wfw:commentRss>
		</item>
		<item>
		<title>php touch函数的使用以及问题</title>
		<link>http://blog.asdjkl.net/archives/23</link>
		<comments>http://blog.asdjkl.net/archives/23#comments</comments>
		<pubDate>Sat, 02 Aug 2008 09:45:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php日记]]></category>

		<category><![CDATA[php touch]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=23</guid>
		<description><![CDATA[php touch函数是一个有趣的函数
php touch函数用法为:touch($filename);
这个语句会发生什么？
1.如果$filename 不存在，则创建一个空文件，命名为$filename
注意：这份空文件的编码是比较奇怪的，即便你的php header设定成某个编码 utf8 或者gbk，它是不理睬你的。
所以我觉得拿来创建未来需要读取内容的文件是不合适的，比如你用touch(&#8217;test.txt&#8217;)，生成test.txt ，在后续程序中你写入了数字，中文，英文，等你再读test.txt出来，会发现跟你想要的是两回事，虽然看起来你写的程序好像没什么问题，就是得不到你想要的值，问题就出在编码上。(当然你用覆盖的方式继续使用倒是没什么问题，你用&#8217;ab+&#8217;类似这样添加的方式进行会出现问题。)
我是没有找到如何指定php touch 生成一定目标的编码0大小文件，你找到一定要告诉我啊。
php touch创建生成的文件拿来做&#8221;标志位&#8221;我觉得是合适的，比如你touch(&#8217;visit.lock&#8217;)这样生成visit.lock文件之后，你可以用file_exits 去判断如果文件存在则干嘛干嘛，如果不存在则干嘛干嘛。
2.如果$filename存在
php touch 会改变$filename的什么值呢？php touch会改变$filename的最后访问时间。注意是访问时间，不是创建这份文件的时间。这个功能可以让你做一些时间间隔的限制动作，比如这句话(time()-fileatime($filename)
意思是从上次访问这份$filename以后，已经过了多少时间？比如这样
if((time()-fileatime($filename) >600)   echo &#8216;距离上次访问这份文件，已经过了10分钟&#8217;;
我还是挺常用这个函数的，就是若是能解决第一个问题就好了。
此处留下笔记&#8230;
]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/23/feed</wfw:commentRss>
		</item>
		<item>
		<title>php ajax 初步应用以及php ajax乱码问题。</title>
		<link>http://blog.asdjkl.net/archives/22</link>
		<comments>http://blog.asdjkl.net/archives/22#comments</comments>
		<pubDate>Thu, 31 Jul 2008 12:50:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<category><![CDATA[php ajax]]></category>

		<category><![CDATA[php ajax 乱码]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=22</guid>
		<description><![CDATA[php ajax 的应用主要是用在一些不需要刷新的数据提交上，随便起一个例子
顺便看看php ajax 的乱码问题。
下面是某个xxx.js的源码

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
 * 初始化一个xmlhttp对象
 */
function InitAjax&#40;&#41;
&#123;
 var ajax=false; 
 try &#123; 
  ajax = new ActiveXObject&#40;&#34;Msxml2.XMLHTTP&#34;&#41;; 
 &#125; catch &#40;e&#41; &#123; 
  try &#123; 
   ajax = new ActiveXObject&#40;&#34;Microsoft.XMLHTTP&#34;&#41;; 
  &#125; catch &#40;E&#41; &#123; 
   ajax = false; 
  &#125; 
 &#125;
 if &#40;!ajax [...]]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/22/feed</wfw:commentRss>
		</item>
		<item>
		<title>php 参数传递以及php获取url参数之后的较合理安排</title>
		<link>http://blog.asdjkl.net/archives/21</link>
		<comments>http://blog.asdjkl.net/archives/21#comments</comments>
		<pubDate>Mon, 21 Jul 2008 14:12:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<category><![CDATA[php 参数传递]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=21</guid>
		<description><![CDATA[php 传参数，有两种方式GET 和POST，今天说的是url里面的参数传递，php get参数方法
举例一下，index.php?do=fly
$_GET[&#8217;do&#8217;] 这样就能取到fly这个值了，这个时候，我们php url的参数传递的一个特点就出来了
1.很明显，它是明文的，所以它是不保密的哦
问题来了，我要保密怎么办？以面的参数为例，你可以把fly算成另外的值
直观点就是：fly加密得到 abcdef 这个值 也就是说 abcdef在你的程序里就代表了fly这个值，而对外人来说就是无意义的值了。。。(说的好罗嗦啊。。。。。)
2.参数的合理安排
php参数传递来后的合理安排，这个是从Comsenz Inc. 出的ucenter home 里面学来的。
废话不多说，看源代码片段，全代码请自行下载了～

1
2
3
4
5
6
7
8
9
//以space.php为例
//允许动作
$dos = array&#40;'feed', 'doing', 'blog', 'album', 'thread', 'mtag', 'friend', 'wall', 'tag', 'notice', 'share', 'home', 'pm', 'app'&#41;;
&#160;
//...省略数句，直接看这个
$do = &#40;!empty&#40;$_GET&#91;'do'&#93;&#41; &#38;&#38; in_array&#40;$_GET&#91;'do'&#93;, $dos&#41;&#41;?$_GET&#91;'do'&#93;:'index';
&#160;
//最后根据动作的值分到其他模块
include_once&#40;S_ROOT.&#34;./source/space_{$do}.php&#34;&#41;;

要虚心学习这段程序的大方向，:-）
它是这个意思：space.php 这个执行脚本，只允许传递$dos数组里的存在的值
比如如果脚本space.php这样传递了参数: space.php?do=feed，那么上面的代码将会直接冲向 space_feed.php去执行！
这样我觉得至少有两个好处
1.一般可以无视用户传来的不合理值，因为它会默认space.php?do=index，看看中间那句(老实说，我是不常用，不过自此以后，我要开始用了)
2.减少space.php的文件大小，这个怎么说呢？
假设你原来有do=index(假设代码量10k)  和 do=blog(假设代码量5k) 两个值
如果不按照上面的方法&#8221;分流&#8221;的话，那么space.php的代码量就是 do=index + do=blog 约等于15k了
如果&#8221;分流&#8221;的话 space.php 1k   space_index.php 10k   space_blog.php 5k
看见了吗？你做space.php?do=blog [...]]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/21/feed</wfw:commentRss>
		</item>
		<item>
		<title>超级简化的js 确认框，弹出确认取消对话框</title>
		<link>http://blog.asdjkl.net/archives/20</link>
		<comments>http://blog.asdjkl.net/archives/20#comments</comments>
		<pubDate>Mon, 21 Jul 2008 02:39:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[网页设计]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=20</guid>
		<description><![CDATA[确认删除或者确认提交的时候，经常需要弹出一个确认框。
今天看到一个js的确认方法，超级简单

1
&#60;input type=&#34;submit&#34;  value=&#34;永久删除&#34; onclick=&#34;return(confirm('确定删除?'))&#34; /&#62;

]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/20/feed</wfw:commentRss>
		</item>
		<item>
		<title>让js每次都读取新内容忽略缓存</title>
		<link>http://blog.asdjkl.net/archives/19</link>
		<comments>http://blog.asdjkl.net/archives/19#comments</comments>
		<pubDate>Mon, 07 Jul 2008 10:47:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<category><![CDATA[js 缓存]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=19</guid>
		<description><![CDATA[我有这么一段代码

1
&#60;script src=&#34;show.php&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;

 
这个是在网页加载的同时，暗地里执行一段php，为网页里的js 参数赋值的
在调试过程中，我就发现：改一次show.php，按F5，实际上是没有变化的，必须按ctrl+F5(忽略缓存强制更新)。
这是十分讨厌的问题。
而且如果你结合ajax的话，会发现，其实后台数据已经变化好了，但是你按F5，仍然是不更新的。
问题就出在这个暗中调用的show.php，每次都是读取缓存，造成数据不更新。
解决的方向一般是，show.php每次都加上不同的参数，比如show.php?time=time() 这样，ie这个笨蛋就认为这是个新链接，它就会去读取新的内容了。
有两种带入的参数可选
1.随机数
2.时间数 (用毫秒的)
上面的代码大概改成类似这个样子

1
2
&#60;script src=&#34;show.php?time={$time}&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;
//其中{$time} 你喜欢用什么生成就用什么生成。

]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>日本八国峰会,或将联手干预美元</title>
		<link>http://blog.asdjkl.net/archives/18</link>
		<comments>http://blog.asdjkl.net/archives/18#comments</comments>
		<pubDate>Sat, 21 Jun 2008 03:07:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[随便杂谈]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=18</guid>
		<description><![CDATA[2008年八国峰会定于7月7日至9日在日本北海道洞爷湖举行。日本财政大臣大田弘子表示，如何应对通货膨胀，将成为八国集团会议讨论的首要议题。另外，经济学家预测，G8国家可能将在会议上讨论如何抑制美元贬值的问题。
根据日本财政部早些时候发布的数据显示，原材料商品价格快速飙升，已经侵蚀了大部分公司的利润。今年1~3月，日本公司税前利润与去年同期相比，大幅下降了17.5%，跌幅之大创过去6年的新高。大田弘子表示，食品和原油价格大幅飙升，给世界经济带来了重大的不确定性，最终将引发全球性的通货膨胀。届时，各国对于宏观经济政策的制定，将会面临非常严重的困难。于是，如何应对通货膨胀，将成为这次八国集团会议的首要议题。
分析人士称，世界经济短期前景十分不容乐观，美国次贷危机导致的全球金融市场动荡仍然充满不确定性。国际原油价格的大幅飙升，可能会挫伤消费者的积极性。除此之外，还会使经济增长放缓，甚至出现下滑现象。如果G8等国在今后的政策中能够避免犯错误，从中长期看，世界经济仍然可能恢复强势的增长。
另据报道，美联储主席伯南克今日强调，美元贬值是导致通货膨胀的关键因素。针对这番讲话，国际分析家认为，似乎G8国家的财长已经在美元议题上取得共识，即认同美元贬值将造成全球经济与金融市场的不稳定。
分析师预测，美元在今后可能会止跌回升。如果美元一直处于跌势，不排除G8国家会出手干预的可能性。在此次G8峰会上，相关国家可能将会对这一问题进行磋商。不过，按照现在的市场氛围，除非美元出现大跌的情况，否则G8不可能会进行联合干预。
 
]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/18/feed</wfw:commentRss>
		</item>
		<item>
		<title>对 获取当前php运行脚本所在目录 的补充</title>
		<link>http://blog.asdjkl.net/archives/17</link>
		<comments>http://blog.asdjkl.net/archives/17#comments</comments>
		<pubDate>Thu, 29 May 2008 06:51:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[php技巧]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=17</guid>
		<description><![CDATA[前面有一篇 获取当前php运行脚本所在目录
实际运用的时候
如果$_SERVER[&#8217;PHP_SELF&#8217;] 这个出错，可以用$_SERVER[&#8217;SCRIPT_NAME&#8217;] 代替
效果是一样的
]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/17/feed</wfw:commentRss>
		</item>
		<item>
		<title>php编译以后$_server无法使用</title>
		<link>http://blog.asdjkl.net/archives/16</link>
		<comments>http://blog.asdjkl.net/archives/16#comments</comments>
		<pubDate>Thu, 29 May 2008 03:53:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.asdjkl.net/?p=16</guid>
		<description><![CDATA[今天编译了一个小类，这才发现，这个类别无论如何都取不到$_server了
print_r($_server) 没有任何结果
真的太晕了
不知道是什么原因
也许是编译上有什么参数要设定
0604补充:
如果用官方的zend guard 好像可以运行了，不过，文件反而变大，大一倍，我晕倒。。。
这玩意真是的挑剔啊
]]></description>
		<wfw:commentRss>http://blog.asdjkl.net/archives/16/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
