⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myfunction.php

📁 多用户PHP统计系统 1.统计系统支持多用户申请 2.两种统计模式:1.页面浏览统计 2.独立IP统计 3.两种统计图样:1.统计小图标显示 2.数字样式,共几十种数字样式,还可以自己增加 4
💻 PHP
字号:
<?
//以下为公用函数
function goback($str,$alertstr)//为空时后退
{ 
 if($str=="")
 {
  echo "<script>";
  echo "alert('".$alertstr."');";
  echo "history.go(-1)";
  echo "</script>";
  exit;
 }
 else
 {
  return $str;
 }
}

function alertback($alertstr,$backnum)
{
  echo "<script>";
  echo "alert('".$alertstr."');";
  echo "history.go(-".$backnum.")";
  echo "</script>";
  exit;
}

function alerturl($alertstr,$url)
{
  echo "<script>";
  echo "alert('".$alertstr."');";
  echo "location.href='".$url."';";
  echo "</script>";
  exit;
}

function gotourl($url)
{
  echo "<script>";
  echo "location.href='".$url."';";
  echo "</script>";
  exit;
}

function chkstr($paravalue,$paratype) //过滤非法字符
{
 if($paratype==1)
 {
  $inputstr=str_replace("'","''",$paravalue);
  }
 elseif($paratype==2)
 {
   if($paratype!=""&&is_numeric($paravalue)==false)
   {
     echo "传递的参数类型有错误!";
     exit;
	}
   else
   { 
    $inputstr=$paravalue;
    }
 }
 elseif($paratype==3)
 {
   if($paratype!=""&&strtotime($paravalue)==false)
   {
     echo("传递的参数类型有错误!");
     exit;
   }
   else
   { 
    $inputstr=$paravalue;
    }
 }

 return $inputstr;
}


function httppath($assort)
{
 $ser=$_SERVER['HTTP_HOST'];
 $scr=$_SERVER['SCRIPT_NAME'];

 $scr_2=substr($scr,0,strrpos($scr,"/")+1);

 if($assort==1)
 {
  $httppath=$ser;
 }
 elseif($assort==2)
 {
   $httppath="http://".$ser.$scr_2;
 }
 elseif($assort==3)
 {
   $httppath="http://".$ser.$scr;
 }

return $httppath;
}


function beakurl($url)
{
 if($url<>"-")
 {
  $urlarrary=explode("/",$url);
  $breakurl=$urlarrary[2];
 }
 else
 {
  $breakurl=$url;
 }
 return $breakurl;
}


function countercode($style,$width,$count,$tmp,$title)
{
$len = strlen($count);

if($len > $width)
{
 $width = $len;
}

for ($i=0;$i<$width;$i++)
{
 $n = $count % 10;
 $count = $count / 10;
 $gifs[$width-$i-1]=$n;
}

$countercode="<a href=".$tmp."index.php target=_blank title=".$title.">";

for ($i=0;$i<$width;$i++)
{
 $countercode=$countercode."<img src=".$tmp."counterpic/".$style."/".$gifs[$i].".gif border=0>";
}

$countercode=$countercode."</a>";

return $countercode;
}


function usercheckout()
{
 $_SESSION["cfstatuser"]="";
 setcookie("cfstatusercookie","",time()-1);
 gotourl("index.php");
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -