= ''((''.$this->user.''(:''.$this->password.'')?@)?''.$this->hostport.'')'';
$this->ftptype = ''[aidAID]'';
$this->fsegment = ''((''.$this->uchar.''|[?:@&=])*)'';
$this->fpath = ''(''.$this->fsegment.''(/''.$this->fsegment.'')*)'';
$this->ftpurl = ''([fF][tT][pP]://''.$this->login.''(/''.$this->fpath.''(;[tT][yY][pP][eE]=''.$this->ftptype.'')?)?)'';
$this->fileurl = ''([fF][iI][lL][eE]://(''.$this->host.''|[lL][oO][cC][aA][lL][hH][oO][sS][tT])?/''.$this->fpath.'')'';
$this->search = ''((''.$this->uchar.''|[;:@&=])*)'';
$this->hsegment = ''((''.$this->uchar.''|[;:@&=])*)'';
$this->hpath = ''(''.$this->hsegment.''(/''.$this->hsegment.'')*)'';
$this->httpurl = ''([hH][tT][tT][pP][sS]?://''.$this->hostport.''(/''.$this->hpath.''([?]''.$this->search.'')?)?)'';
$this->gopher_string = ''(''.$this->xchar.''*)'';
$this->selector = ''(''.$this->xchar.''*)'';
$this->gtype = $this->xchar;
$this->gopherurl = ''([gG][oO][pP][hH][eE][rR]://''.$this->hostport.''(/(''.$this->gtype.''(''.$this->selector.''(%09''.$this->search.''(%09''.$this->gopher_string.'')?)?)?)?)?)'';
$this->article = ''((''.$this->uchar.''|[;/?:&=])+@''.$this->host.'')'';
$this->group = ''(''.$this->alpha.''(''.$this->alpha.''|''.$this->digit.''|[-.+_])*)'';
$this->grouppart = ''([*]|''.$this->group.''|''.$this->article.'')'';
$this->newsurl = ''([nN][eE][wW][sS]:''.$this->grouppart.'')'';
$this->nntpurl = ''([nN][nN][tT][pP]://''.$this->hostport.''/''.$this->group.''(/''.$this->digits.'')?)'';
$this->telneturl = ''([tT][eE][lL][nN][eE][tT]://''.$this->login.''/?)'';
$this->wpath = ''(''.$this->uchar.''*)'';
$this->wtype = ''(''.$this->uchar.''*)'';
$this->database = ''(''.$this->uchar.''*)'';
$this->waisdoc = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.''/''.$this->wtype.''/''.$this->wpath.'')'';
$this->waisindex = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.''[?]''.$this->search.'')'';
$this->waisdatabase = ''([wW][aA][iI][sS]://''.$this->hostport.''/''.$this->database.'')'';
$this->waisurl = ''(''.$this->waisdatabase.''|''.$this->waisindex.''|''.$this->waisdoc.'')'';
}
}
?>
文件otherfunc.php的内容
<?php
//otherfunc.php
function htmlencode($str){
$str = (string)$str;
$ret = '''';
$len = strlen($str);
$nl = false;
for($i=0;$i<$len;$i++){
$chr = $str[$i];
switch($chr){
case ''<'':
$ret .= ''<'';
$nl = false;
break;
case ''>'':
$ret .= ''>'';
$nl = false;
break;
case ''"'':
$ret .= ''"'';
$nl = false;
break;
case ''&'':
$ret .= ''&'';
$nl = false;
break;
/*
case '' '':
$ret .= '' '';
$nl = false;
break;
*/
case chr(9):
$ret .= '' '';
$nl = false;
break;
case chr(10):
if($nl) $nl = false;
else{
$ret .= ''<br>'';
$nl = true;
}
break;
case chr(13):
if($nl) $nl = fal