首页 >php教程 >php手册 >用PHP和ACCESS写聊天室(三)

用PHP和ACCESS写聊天室(三)

WBOY
WBOY原创
2016-06-21 09:02:55906浏览
cinput.php3
如下:


输入






function suiji($max){
    srand((double)microtime()*1000000);
    $x=rand();
    $y=getrandmax();
    $r=$x/$y*($max-1);
    $r=round($r++);
    return $r;
}

function StrOccurs($sStr, $sFind){
    $sTemp=$sStr;
    $iLen=strlen($sFind);
    $iCount=0;
    while (true){
        if (strstr($sTemp, $sFind))
            break;
        else{
            $sTemp = substr($sTemp,strpos($sTemp,$sFind)+$iLen);
            $iCount++;
        }
    }
    return $iCount;
}

function StrDupl($sStr, $iCnt){
    $ret="";
    for($i=1;$i        $ret.=$sStr;
    return $ret;
}

function DelQuot($sStr){
    $s=str_replace(chr(124),"¦",$sStr);
    $s=str_replace(chr(39),"´",$s);
    $s=str_replace(chr(34),""",$s);
    return $s;
}

function DelTag($sStr){
    $bNeed="False";
    $sOther=strtoupper($sStr);
    if ($bNeed!="True" || !strstr($sOther,"
    if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
    if ($bNeed!="True" || !strstr($sOther,"<script></script>    if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
    if ($bNeed!="True" || !strstr($sOther,"
    if ($bNeed!="True" || !strstr($sOther,"")) $bNeed="True";
    if ($bNeed!="True" || !strstr($sOther,"
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn