Thursday, 26. April 2007, 04:53:07
php
js 取 cookie 的中文乱码
php 写 cookie
$username="小群";
$username=mb_convert_encoding($username,"UTF-8","GB2312"); //因为 此文件为ascii 编码
//$username=iconv("GB2312","UTF-8",$username);
$username=urlencode($username); //这个 函数出来的 结果 与 js cookie
setcookie('testname',$username,time()+3600);
js 取cookie
//document.write( document.cookie);
document.writeln(decodeURI("<?= $username ?>")) ;
document.writeln(GetCookie("testname")) ;
function GetCookie(cookieName){
var cookieString = document.cookie;
//return cookieString;
var start = cookieString.indexOf(cookieName + '=');
if (start == -1)
return null;
start += cookieName.length + 1;
var end = cookieString.indexOf(";", start);
if (end == -1)
return decodeURI(cookieString.substring(start));
//return unescape(cookieString.substring(start));
return decodeURI(cookieString.substring(start, end));
//return unescape(cookieString.substring(start, end));
}
因为我们php写cookie 直接 是原来的 string,未加 urlencode 这类函数.
js 取 cookie 时发现 与 urlencode(string) 后的 结果 相同.
所以 在 js 中 改 unescape 为 decodeURI
js 取cookie 好像也只认 utf8 编码的.所以
php写cookie之前 要 转为utf8
Tuesday, 24. April 2007, 04:43:17
mysql, php, apache, system
硬盘空间配额 file system quota
我们的server 出了问题, 除了root 用户,可以正常上传文件 ,其它 用户, 包括 apache 都不可以 正常写入文件.写任何文件 都是 0 字节.
好多天来, 重装 apache php mysql ,可以暂时解决 问题,但没过多久问题还是 出来了.
一开始 重装 后 可以用上几天, 现在装完就没用.
这样一天 就过去 也没找到问题.
今天 用某用户 vi 写一文件 报错了
E514: write error (file system full?)
找到 一篇 说
...turns out I went over my quota on the server...
kevin 说空间配额 问题?
df 查一下
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 2016016 1937348 0 100% /
none 1037212 0 1037212 0% /dev/shm
/dev/sda5 70880216 1750920 65528732 3% /usr
/dev/sda3 2016044 163708 1749924 9% /var
my god. 我们的网站放在 /home 下的.空间全用光了.
文件 当然写不进去了.
Wednesday, 18. April 2007, 06:19:56
[^_0-9a-zA-Z\-.=+\(\),;'"`<>\[\]\$ ]
在 js 中 可用
[^\x00-\xFF]
Tuesday, 17. April 2007, 03:42:39
system
主要是 php
./configure --with-apxs2=/home/webadm/bin/apxs --disable-debug --with-mysql=/home/mysql5 --enable-so --with-libxml-dir=/home/libxml --enable-mbstring --with-gd --with-zlib --with-png --with-jpeg --with-xsl=/home/libxslt/lib
----------
xsl libxslt 的加载php5 为
--with-xsl=/home/libxslt/lib
不是
--with-libxsl-dir=/
Wednesday, 11. April 2007, 16:51:26
system
现在的病毒 确实不是我所解决得了。有太多的文件 被感染。
而且我又不可以狠下心,把这些全删除掉。
卡巴斯基 试用,可以。
几乎全部的 exe 文件都被感染
viking.kl
电脑真是减寿啊。
Tuesday, 10. April 2007, 08:56:18
php
Monday, 9. April 2007, 03:37:36
system
电脑再次中病毒
首先,我的电脑是不装杀毒软件的,并且是给大家随便用的。出现病毒应该是正常情况,这也意味着我的电脑与我,已经开始与病毒做斗争。
症状:windows\ 下 多个 8y,9y,log1_ 这样的东西。
删除后 发现 每过1分钟,进程多出一个 IExplore,共6个后, 停止增加。每一个进程 用18M,共用去100M 内存。
在无杀毒软件可用的情况下,
用Ghost 还原上次的备份, 开机就发现 已经中毒了。因为开机时 有些服务已经启动。apache,mysql 放在 D盘的。
看来这个病毒已经 感染了 所有 exe 文件.
舍不得删除啊,改了目录名。
再用Ghost 还原,这次开机未有病毒了.
但还未根治,也许只能 Delete all exe programs .
Sunday, 1. April 2007, 15:04:47
system
问题多多
1, 我的screen 是什么?识不出来了.
2, firefox 没了,自己下.
还好 ,
http://www.mozilla.com/en-US/firefox/ 2.0.0.3 for Linux i686, Chinese (Simplified) (9.2MB)
网站自识别 系统 不错.
tar.gz 包 , tar zvft XXX 解压后 ... 没有安装文件,只有一个 firefox 可执行
可用. 不必安装..
Thursday, 29. March 2007, 10:14:35
php, mysql
用了 rand() 并且要 分页.
Select * From table order by rand() Limit 10
问题是 分页一下,就会 重新对全部记录随机 一次.
若为 rand(100) 加上基数
则 Limit 不会 重新随机..
Select * From table order by rand($r) Limit 10,10
Friday, 23. March 2007, 02:59:56
system, apache
apache
httpd.conf
加入以下 配置 虚拟机 代码
Listen 80
Listen 8000
NameVirtualHost *:80
NameVirtualHost *:8000
<VirtualHost *:80>
DocumentRoot "/home/webadm/htdocs"
ServerName *:80
</VirtualHost>
<VirtualHost *:8000>
DocumentRoot "/home/webadm/htdocs/popen"
ServerName *:8000
</VirtualHost>
OK,但 发现另一问题, linux 下好像不能访问 8000 端口?
service iptables stop
关闭 iptables
Showing posts 1 -
10 of 51.