<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>PHPStat 流量统计JS代码嵌入工具</title>
<STYLE type=text/css>
body {font-family: "Verdana", "宋体";font-size:"13px";}
td {font-family: "Verdana", "宋体";font-size:12px;line-height:140%;}
A:active {COLOR: #000000; TEXT-DECORATION: underline}
A:visited {COLOR: #455164; TEXT-DECORATION: underline}
A:hover {COLOR: #000000; TEXT-DECORATION: none}
A:link {COLOR: #455164; TEXT-DECORATION: underline}
.title {font-size:"14px";}
.f14px {
	font-size: 14px;
	font-weight: bold;
}
</STYLE>
</head>
<body leftmargin="0" topmargin="20" marginwidth="0" marginheight="0">
<center>
  <table border="0" align="center" cellpadding="10" cellspacing="5">
    <tr>
      <td width="417" align="center" class="title"><b>PHPStat&#8482;        流量统计JS代码嵌入工具</b></td>
    </tr>
  </table>
  <table width="650" border="0" cellspacing="1" cellpadding="5">
    <tr> 
      <td><span class="f14px">如果您的站点使用脚本语言 (如HTMLL,SHTML,ASP, PHP, PERL, PYTHON, JSP..) 或者是 一种可编译的语言(如C, JAVA),   可以该<b>工具</b>获取任何一种可以嵌入的标准代码.</span><BR>
      <hr size="1" noshade style="border: 1px dotted #000000;">
        <table width="98%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><form name="form1" method="post" action="">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td>统计代码类型</td>
                  <td><select name="jscodetype" id="jscodetype">
                    <option value="js">嵌入到JS代码里面</option>
                    <option value="php">嵌入到PHP,Python,PERL文件里面的标准代码</option>
                    <option value="jsp">嵌入到JSP代码里面</option>
                  </select> <input name="error" type="checkbox" id="error" value="1">
                  <strong>加入排错代码</strong></td>
                </tr>
                <tr>
                  <td width="21%">要转换的统计代码</td>
                  <td width="79%"><textarea name="jscode" cols="66" rows="10" onFocus="this.select()" id="jscode"><?=str_replace("\\","",$_POST[jscode])?></textarea></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td><input name="action" type="hidden" id="action" value="change"></td>
                </tr>
				<? if ($_POST[action] == "change" ){ 
					$code = explode("\r\n",$_POST[jscode]);
					$lines = 3;
					if( count( $code ) > 0)
					foreach( $code as $oneline )
					  {	
						$lines++;
						
						if( $_POST[jscodetype] == "php" ) 
						  {							
						    $word = "嵌入到PHP,Python,PERL文件里面的标准代码";
							$newcode = str_replace("\r\n","",$oneline);
							$newcode = str_replace("\"","\"",$oneline);						
							$newcode = "print(\"".$newcode."\");"."\n";
							$newcodes .= $newcode;
							if( $lines == 5 and $_POST[error] == "1")
							{
								$newcodes .= "print(\"var _Debug=true;\");\n";
							}
							
						  }
						 if( $_POST[jscodetype] == "jsp" ) 
						  {
							$word = "嵌入到JSP文件里面的标准代码";
							$newcode = str_replace("\r\n","",$oneline);
							$newcode = str_replace("\"","\"",$oneline);
							$newcode = "out.println(\"".$newcode."\");"."\n";
							$newcodes .= $newcode;
							if( $lines == 5 and $_POST[error] == "1")
							{
								$newcodes .= "out.println(\"var _Debug=true;\");\n";
							}
							
						  }
						 if( $_POST[jscodetype] == "js" ) 
						  {
							$word = "嵌入到JS文件里面的标准代码";
							$newcode = str_replace("\r\n","",$oneline);
							$newcode = str_replace("\"","\"",$oneline);
							$newcode = "document.write(\"".$newcode."\");"."\n";
							$newcodes .= $newcode;
							if( $lines == 5 and $_POST[error] == "1")
							{
								$newcodes .= "document.write(\"var _Debug=true;\");\n";
							}							
						  }
					  }
				if( $lines < 5 ) $lines = 5;	  
			
				?>

                <tr>
                  <td>&nbsp;</td>
                  <td><?=$word?></td>
                </tr>
                <tr>
                  <td>标准嵌入统计代码</td>
                  <td><textarea name="getcode" cols="66" rows="<?=$lines?>" onFocus="this.select()" id="getcode"><?=$newcodes?></textarea></td>
                </tr>
				<? } ?>
                <tr>
                  <td>&nbsp;</td>
                  <td><input type="submit" name="Submit" value="转换代码"></td>
                </tr>
              </table>
                        </form>
            </td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p class="f14px">特别说明 </p>
        <hr size="1" noshade style="border: 1px dotted #000000;">
        <ul>
          <li>http://www.phpstat.net</li>
            <li> QQ:158839753 </li>
            <li>Email:wiwiboy@126.com</li>
            <li>Tel:15990206416/13553166317</li>
      </ul></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <br>
  <table border="0" align="center" cellpadding="3" cellspacing="0">
    <tr>
      <td align="center"><strong> 
        <b>Powered 
        by: 
        PHPStat</b><br>
        Copyright 
        &copy; 
        2007 
        <b>PHPStat</b> 
        All 
        Rights 
        Reserved.</strong>

</td>
    </tr>
  </table>
</center>
</body>
</html>
