将Blog进行到底——在Gmail里用Blog
作者:chill 日期:2005-08-27 14:47
男人 不成熟的30个标志
作者:chill 日期:2005-08-27 11:19
同时使用apache和IIS,共用80端口的一个解决方案
作者:chill 日期:2005-08-26 17:51
作者:Anjer
将apache设为使用80端口,IIS使用其它端口,比如81,然后将apache作为IIS的代理。
在httpd.conf里面,取消下面四行的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
然后建立一个虚拟主机,将该域名的所有访问转向81端口。
ServerName iloves.vicp.net
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
这样,对外就可以只需要一个端口,即可同时使用apache和IIS的功能了
将apache设为使用80端口,IIS使用其它端口,比如81,然后将apache作为IIS的代理。
在httpd.conf里面,取消下面四行的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
然后建立一个虚拟主机,将该域名的所有访问转向81端口。
ServerName iloves.vicp.net
ProxyPass / http://localhost:81/
ProxyPassReverse / http://localhost:81/
这样,对外就可以只需要一个端口,即可同时使用apache和IIS的功能了
mysql类
作者:chill 日期:2005-08-26 17:34
<?
class mysqlquery
{var $sql;//sql语句执行结果
var $query;//sql语句
var $num;//返回记录数
var $r;//返回数组
var $id;//返回数据库id号
//###############################执行mysql_query()语句#######################
function query($query)
{
$this->$sql=mysql_query($query) or die(mysql_error());
return $this->$sql;
}
//########################################执行mysql_fetch_array()#############################
function fetch($sql)//此方法的参数是$sql就是sql语句执行结果
{
$this->$r=mysql_fetch_array($sql);
return $this->$r;
}
//#################执行fetchone(mysql_fetch_array())##############################
//此方法与fetch()的区别是:1、此方法的参数是$query就是sql语句
//2、此方法用于while(),for()数据库指针不会自动下移,而fetch()可以自动下移。
function fetch1($query)
{
$this->$sql=$this->query($query);
$this->$r=mysql_fetch_array($this->$sql);
return $this->$r;
}
//############################执行mysql_num_rows()#######################
function num($query)//此类的参数是$query就是sql语句
{
$this->$sql=$this->query($query);
$this->$num=mysql_num_rows($this->$sql);
return $this->$num;
}
//###########################执行numone(mysql_num_rows())####################
//此方法与num()的区别是:1、此方法的参数是$sql就是sql语句的执行结果。
function num1($sql)
{$this->$num=mysql_num_rows($sql);
return $this->$num;
}
//###############################执行free(mysql_result_free())#################
//此方法的参数是$sql就是sql语句的执行结果。只有在用到mysql_fetch_array的情况下用
function free($sql)
{mysql_free_result($sql);
}
//###########################执行seek(mysql_data_seek())#################
//此方法的参数是$sql就是sql语句的执行结果,$pit为执行指针的偏移数
function seek($sql,$pit)
{mysql_data_seek($sql,$pit);
}
//###########################执行id(mysql_insert_id())####################
function lastid()//取得最后一次执行mysql数据库id号
{$this->$id=mysql_insert_id();
return $this->$id;
}
//########################################################
}
?>
class mysqlquery
{var $sql;//sql语句执行结果
var $query;//sql语句
var $num;//返回记录数
var $r;//返回数组
var $id;//返回数据库id号
//###############################执行mysql_query()语句#######################
function query($query)
{
$this->$sql=mysql_query($query) or die(mysql_error());
return $this->$sql;
}
//########################################执行mysql_fetch_array()#############################
function fetch($sql)//此方法的参数是$sql就是sql语句执行结果
{
$this->$r=mysql_fetch_array($sql);
return $this->$r;
}
//#################执行fetchone(mysql_fetch_array())##############################
//此方法与fetch()的区别是:1、此方法的参数是$query就是sql语句
//2、此方法用于while(),for()数据库指针不会自动下移,而fetch()可以自动下移。
function fetch1($query)
{
$this->$sql=$this->query($query);
$this->$r=mysql_fetch_array($this->$sql);
return $this->$r;
}
//############################执行mysql_num_rows()#######################
function num($query)//此类的参数是$query就是sql语句
{
$this->$sql=$this->query($query);
$this->$num=mysql_num_rows($this->$sql);
return $this->$num;
}
//###########################执行numone(mysql_num_rows())####################
//此方法与num()的区别是:1、此方法的参数是$sql就是sql语句的执行结果。
function num1($sql)
{$this->$num=mysql_num_rows($sql);
return $this->$num;
}
//###############################执行free(mysql_result_free())#################
//此方法的参数是$sql就是sql语句的执行结果。只有在用到mysql_fetch_array的情况下用
function free($sql)
{mysql_free_result($sql);
}
//###########################执行seek(mysql_data_seek())#################
//此方法的参数是$sql就是sql语句的执行结果,$pit为执行指针的偏移数
function seek($sql,$pit)
{mysql_data_seek($sql,$pit);
}
//###########################执行id(mysql_insert_id())####################
function lastid()//取得最后一次执行mysql数据库id号
{$this->$id=mysql_insert_id();
return $this->$id;
}
//########################################################
}
?>
(转自:www.phome.net)
小写数字金额,转换成大写中文,绝无错误
作者:chill 日期:2005-08-26 17:31
下载: example.php
- function mxb(){
- newchar="";
- Num=document.form1.money.value;
- for(i=Num.length-1;i>=0;i--)
- {
- Num = Num.replace(",","")//替换tomoney()中的“,”
- Num = Num.replace(" ","")//替换tomoney()中的空格
- Num = Num.replace("¥","")//替换掉可能出现的¥字符
- }
- if(isNaN(Num))
- { //验证输入的字符是否为数字
- alert("请检查小写金额是否正确");
- return;
- }
- //小数点前进行转化
- part = String(Num).split(".");
- newchar = "";
- for(i=part[0].length-1;i>=0;i--){
- if(part[0].length > 10){ alert("位数过大,无法计算");return "";}//若数量超过拾亿单位,提示
- tmpnewchar = ""
- perchar = part[0].charAt(i);
- switch(perchar){
- case "0": tmpnewchar="零" + tmpnewchar ;break;
- case "1": tmpnewchar="壹" + tmpnewchar ;break;
- case "2": tmpnewchar="贰" + tmpnewchar ;break;
- case "3": tmpnewchar="叁" + tmpnewchar ;break;
- case "4": tmpnewchar="肆" + tmpnewchar ;break;
- case "5": tmpnewchar="伍" + tmpnewchar ;break;
- case "6": tmpnewchar="陆" + tmpnewchar ;break;
- case "7": tmpnewchar="柒" + tmpnewchar ;break;
- case "8": tmpnewchar="捌" + tmpnewchar ;break;
- case "9": tmpnewchar="玖" + tmpnewchar ;break;
- }
- switch(part[0].length-i-1){
- case 0: tmpnewchar = tmpnewchar +"元" ;break;
- case 1: if(perchar!=0)tmpnewchar= tmpnewchar +"拾" ;break;
- case 2: if(perchar!=0)tmpnewchar= tmpnewchar +"佰" ;break;
- case 3: if(perchar!=0)tmpnewchar= tmpnewchar +"仟" ;break;
- case 4: tmpnewchar= tmpnewchar +"万" ;break;
- case 5: if(perchar!=0)tmpnewchar= tmpnewchar +"拾" ;break;
- case 6: if(perchar!=0)tmpnewchar= tmpnewchar +"佰" ;break;
- case 7: if(perchar!=0)tmpnewchar= tmpnewchar +"仟" ;break;
- case 8: tmpnewchar= tmpnewchar +"亿" ;break;
- case 9: tmpnewchar= tmpnewchar +"拾" ;break;
- }
- newchar = tmpnewchar + newchar;
- }
- //for循环结束
- if(Num.indexOf(".")!=-1){
- for(i=0;i<part[1].length;i++){
- tmpnewchar = ""
- perchar = part[1].charAt(i)
- switch(perchar){
- case "0": tmpnewchar="零" + tmpnewchar ;break;
- case "1": tmpnewchar="壹" + tmpnewchar ;break;
- case "2": tmpnewchar="贰" + tmpnewchar ;break;
- case "3": tmpnewchar="叁" + tmpnewchar ;break;
- case "4": tmpnewchar="肆" + tmpnewchar ;break;
- case "5": tmpnewchar="伍" + tmpnewchar ;break;
- case "6": tmpnewchar="陆" + tmpnewchar ;break;
- case "7": tmpnewchar="柒" + tmpnewchar ;break;
- case "8": tmpnewchar="捌" + tmpnewchar ;break;
- case "9": tmpnewchar="玖" + tmpnewchar ;break;
- }
- if(i==0)tmpnewchar =tmpnewchar + "角";
- if(i==1)tmpnewchar = tmpnewchar + "分";
- newchar = newchar + tmpnewchar;
- }
- }
- //替换所有无用汉字
- while(newchar.search("零零") != -1) {
- newchar = newchar.replace("零零", "零");
- newchar = newchar.replace("零亿", "亿");
- newchar = newchar.replace("亿万", "亿");
- newchar = newchar.replace("零万", "万");
- newchar = newchar.replace("零元", "元");
- newchar = newchar.replace("零元", "元");
- newchar = newchar.replace("零角", "");
- newchar = newchar.replace("零分", "");
- }
- newchar = newchar+"整";
- <!--alert("请确认你录入的金额和类别!!!"+"n"+"n"+"类别为:"+document.form1.kind.value+"n"+"n"+"金额:"+"n"+"n"+newchar);-->
- document.form1.chinamoney.value=newchar;
- }
php图片远程采集
作者:chill 日期:2005-08-26 17:28
<?php
//====================================================
//FileName:class_collect.php
//Summary: 图片数据采集类。
//Author: shenzhe(我爱老婆(泽))
//CreateTime: 2005-3-29
//LastModifed:2005-3-29
//copyright (c)2005 shenzhe__@163.com
//im : qq:31477177 msn :shenzhe__@hotmail.com
//====================================================
class collect
{
var $url; //采集ULR(即采集目标)
var $content; //原始内容
var $result;//采集结果
var $picname; //图片名
var $pictype; //图片类型
//==========================================
// 函数: getUrl($url)
// 功能: 构造函数,得到图片地址
// 参数: &$url 对象
//==========================================
function getUrl($url)
{
$this->url = $url;
}
//==========================================
// 函数: getPType()
// 功能: 构造函数,取得图片类别
// 参数: &$url 对象
//==========================================
function getPType()
{
$end_str = substr($this->url,-5);
if(eregi('.gif',$end_str)){
$this->pictype = "gif";
}elseif(eregi('.bmp',$end_str)){
$this->pictype = "bmp";
}elseif(eregi('.png',$end_str)){
$this->pictype = "png";
}else{
$this->pictype = "jpg";
}
}
//==========================================
// 函数: getContent()
// 功能: 构造函数,取得原始数据
// 参数: 无
//==========================================
function getContent()
{
$fp = fopen($this->url,"r");
while ($line = fgets($fp,1024))
{
$this->content .= $line;
}
fclose($fp);
}
//==========================================
// 函数: getResult()
// 功能: 构造函数,生成图片
// 参数: 无
//==========================================
function getResult()
{
$date = date("YmdHis");
$this->picname = $date.".".$this->pictype;
$fp = fopen($this->picname,"w");
if(fwrite($fp,$this->content)){
fclose ($fp);
return 1;
}else{
fclose ($fp);
return 0;
}
}
//==========================================
// 函数: getMsg()
// 功能: 构造函数,返回信息
// 参数: 无
//==========================================
function getMsg()
{
if ($this->getResult())
{
echo "";
}else{
echo "保存图片失败";
}
}
}
?>
//====================================================
//FileName:class_collect.php
//Summary: 图片数据采集类。
//Author: shenzhe(我爱老婆(泽))
//CreateTime: 2005-3-29
//LastModifed:2005-3-29
//copyright (c)2005 shenzhe__@163.com
//im : qq:31477177 msn :shenzhe__@hotmail.com
//====================================================
class collect
{
var $url; //采集ULR(即采集目标)
var $content; //原始内容
var $result;//采集结果
var $picname; //图片名
var $pictype; //图片类型
//==========================================
// 函数: getUrl($url)
// 功能: 构造函数,得到图片地址
// 参数: &$url 对象
//==========================================
function getUrl($url)
{
$this->url = $url;
}
//==========================================
// 函数: getPType()
// 功能: 构造函数,取得图片类别
// 参数: &$url 对象
//==========================================
function getPType()
{
$end_str = substr($this->url,-5);
if(eregi('.gif',$end_str)){
$this->pictype = "gif";
}elseif(eregi('.bmp',$end_str)){
$this->pictype = "bmp";
}elseif(eregi('.png',$end_str)){
$this->pictype = "png";
}else{
$this->pictype = "jpg";
}
}
//==========================================
// 函数: getContent()
// 功能: 构造函数,取得原始数据
// 参数: 无
//==========================================
function getContent()
{
$fp = fopen($this->url,"r");
while ($line = fgets($fp,1024))
{
$this->content .= $line;
}
fclose($fp);
}
//==========================================
// 函数: getResult()
// 功能: 构造函数,生成图片
// 参数: 无
//==========================================
function getResult()
{
$date = date("YmdHis");
$this->picname = $date.".".$this->pictype;
$fp = fopen($this->picname,"w");
if(fwrite($fp,$this->content)){
fclose ($fp);
return 1;
}else{
fclose ($fp);
return 0;
}
}
//==========================================
// 函数: getMsg()
// 功能: 构造函数,返回信息
// 参数: 无
//==========================================
function getMsg()
{
if ($this->getResult())
{
echo "";
}else{
echo "保存图片失败";
}
}
}
?>
删除无限级目录与文件代码
作者:chill 日期:2005-08-26 17:26
<?
//删除目录
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
class del_path
{
function wm_chief_delpath($del_path)
{
if(!file_exists($del_path))//目标目录不存在则建立
{echo"目录不存在";return false;}
$hand=opendir($del_path);
$i=0;
while($file=readdir($hand))
{$i++;
if($i==1||$i==2)
{continue;}
if(!(strchr($file,".")))
{
$del_s_path=$del_path."/".$file;
$this->wm_chief_delpath($del_s_path);
}
else
{
$del_file=$del_path."/".$file;
$this->wm_chief_file($del_file);
}
}
closedir($hand);
$this->wm_chief_path($del_path);
return true;
}
//删除文件
function wm_chief_file($del_file)
{
unlink($del_file);
}
//删除目录
function wm_chief_path($del_path)
{
rmdir($del_path);
}
}
$DelPath="DelPath";//要删除的目录
$wm_chief=new del_path();
$wm_chief_ok=$wm_chief->wm_chief_delpath($DelPath);
if($wm_chief_ok)
{
echo"删除完毕";
}
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
?>
//删除目录
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
class del_path
{
function wm_chief_delpath($del_path)
{
if(!file_exists($del_path))//目标目录不存在则建立
{echo"目录不存在";return false;}
$hand=opendir($del_path);
$i=0;
while($file=readdir($hand))
{$i++;
if($i==1||$i==2)
{continue;}
if(!(strchr($file,".")))
{
$del_s_path=$del_path."/".$file;
$this->wm_chief_delpath($del_s_path);
}
else
{
$del_file=$del_path."/".$file;
$this->wm_chief_file($del_file);
}
}
closedir($hand);
$this->wm_chief_path($del_path);
return true;
}
//删除文件
function wm_chief_file($del_file)
{
unlink($del_file);
}
//删除目录
function wm_chief_path($del_path)
{
rmdir($del_path);
}
}
$DelPath="DelPath";//要删除的目录
$wm_chief=new del_path();
$wm_chief_ok=$wm_chief->wm_chief_delpath($DelPath);
if($wm_chief_ok)
{
echo"删除完毕";
}
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
?>
(转自:http://www.phome.net)
无限级目录复制
作者:chill 日期:2005-08-26 17:23
无限级目录复制,站长原创,虽只写了短短几分钟,但还是挺有用的
(转自:www.phome.net)
<?
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
$o_path="admin";//源目录
$n_path="n_admin";//新目录
class copy_path
{
function wm_chief_copypath($o_path,$n_path)
{$hand=opendir($o_path);
if(!file_exists($n_path))//目标目录不存在则建立
{$this->wm_chief_createpath($n_path);}
$i=0;
while($file=readdir($hand))
{$i++;
if($i==1||$i==2)
{continue;}
if(!(strchr($file,".")))
{
$o_s_path=$o_path."/".$file;
$n_s_path=$n_path."/".$file;
$this->wm_chief_copypath($o_s_path,$n_s_path);
}
else
{
$o_file=$o_path."/".$file;
$n_file=$n_path."/".$file;
$this->wm_chief_copyfile($o_file,$n_file);
}
}
closedir($hand);
return true;
}
function wm_chief_copyfile($o_file,$n_file)
{
copy($o_file,$n_file);
}
function wm_chief_createpath($n_path)
{
mkdir($n_path,0777);
}
}
$wm_chief=new copy_path();
$wm_chief_ok=$wm_chief->wm_chief_copypath($o_path,$n_path);
if($wm_chief_ok)
{
echo"复制完毕";
}
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
?>
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
$o_path="admin";//源目录
$n_path="n_admin";//新目录
class copy_path
{
function wm_chief_copypath($o_path,$n_path)
{$hand=opendir($o_path);
if(!file_exists($n_path))//目标目录不存在则建立
{$this->wm_chief_createpath($n_path);}
$i=0;
while($file=readdir($hand))
{$i++;
if($i==1||$i==2)
{continue;}
if(!(strchr($file,".")))
{
$o_s_path=$o_path."/".$file;
$n_s_path=$n_path."/".$file;
$this->wm_chief_copypath($o_s_path,$n_s_path);
}
else
{
$o_file=$o_path."/".$file;
$n_file=$n_path."/".$file;
$this->wm_chief_copyfile($o_file,$n_file);
}
}
closedir($hand);
return true;
}
function wm_chief_copyfile($o_file,$n_file)
{
copy($o_file,$n_file);
}
function wm_chief_createpath($n_path)
{
mkdir($n_path,0777);
}
}
$wm_chief=new copy_path();
$wm_chief_ok=$wm_chief->wm_chief_copypath($o_path,$n_path);
if($wm_chief_ok)
{
echo"复制完毕";
}
//本程序由wm_chief原创,如要转载,请注明作者与来源(http://www.phome.net)
?>
(转自:www.phome.net)
本站立志于收集各类技术文档资料,便于本人和广大网友查询检索,任何转载文章均尽力标明来源,无论单位或个人认为本站存在侵权内容均可与本站联系,任何此类反馈信息一经有效身份证明、权属证明及详细侵权情况证明后,将立即清除!对于转载内容,本站不为其版权负责,其任何言论均与本站无关!








