DEDECMS Ajax Download Statistics code

Source: Internet
Author: User
Tags instance method rand

<?php
Require_once (DirName (__file__). "/include/common.inc.php");
Require_once (dedeinc.) /channelunit.class.php ");

$aid = (isset ($aid) && is_numeric ($aid))? $aid: 0;

$rand =mt_rand (10,80);

$query = "SELECT count (*) as DD from #@__downloads where id= ' $aid '";

$row = $dsql->getone ($query);

if ($row [' DD '] > 0)
{
$query = "Update #@__downloads set downloads=downloads+ $rand where id= ' $aid '";
$dsql->execnonequery ($query);
}else {
$query = "INSERT into #@__downloads (hash,id,downloads) VALUES (' Null$aid ', ' $aid ', 1)";
$dsql->execnonequery ($query);
}

The following is an instance method.

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<script src= "Http://pstatic.xunlei.com/js/webThunderDetect.js" > <script src= "http://pstatic.xunlei.com/" Js/base64.js "> <script language=" javascript "type=" Text/javascript ">
var xmlHttp = false;

function Ajaxcreate () {

try {
XmlHttp = new ActiveXObject ("Msxml2.xmlhttp");
catch (e) {
try {
XmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
} catch (E2) {
XmlHttp = false;
}
}

if (!xmlhttp && typeof xmlhttprequest!= ' undefined ') {
XmlHttp = new XMLHttpRequest ();
}
if (!xmlhttp) {alert (' Create xmlHttp Fail '); return false;}
}


function Ajax_add () {
Ajaxcreate ();
var url= "/ajax_down.php?aid=" +encodeuri (5396) + "&rd=" +math.random ();
Xmlhttp.open ("POST", url,true);
Xmlhttp.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Xmlhttp.send (NULL);
}

</script>
<title> Green version apache+php+mysql V1.3 automatic installation version _ download address List _ website source download-Whole station source code download-Webmaster Common tools Download </title>
<link href= "/templets/style/search.css" rel= "stylesheet" type= "text/css" media= "screen"/>
<body>

<div class= "Header" >
<div class= "Toplogo" >
</div>
</div>

<div class= "Msgbar" >
<p>
<strong> software Name: <a href= '/down/soft/server/2009/0629/5396.html ' > Green version apache+php+mysql V1.3 automatic installation version </a> </strong>
</p>
</div>
<div class= "AdvancedSearch" >
<table width= "100%" border= "0" align= "center" cellspacing= "2" >
<tr>
&LT;TD height= bgcolor= "#F2F7E6" > Download address List:</td>
</tr>
<tr>
&LT;TD height= "><script" language= "JavaScript" src= "/js/gg_bottom.js" ></script>
<a href= "#" class= "Red" thunderhref= "thunder:// qufodhrwoi8vemp0zwxlnc5za3ljbi5jb20vzg93bi9nz2dbue1zzxj2zxiuemlwwlo= "thunderpid=" 85957 "thunderType=" " Thunderrestitle= "" onclick= "Ajax_add (); return ondownloadclick_simple (this,2);" Oncontextmenu= "Thundernetwork_ Sethref (This) ">[thunderbolt dedicated download]</a>

<script type= "Text/javascript" ><!--
Google_ad_client = "pub-6219414158063594";
/* 336x280, founded in 09-3-29 * *
Google_ad_slot = "8019903307";
Google_ad_width = 336;
Google_ad_height = 280;
-->
</script>
<script type= "Text/javascript"
src= "Http://pagead2.googlesyndication.com/pagead/show_ads.js" >
</script>

<script type= "Text/javascript" ><!--
Google_ad_client = "pub-6219414158063594";
Google_ad_format = "CONFIGURABLE_SDO";
Google_link_target = 2;
GOOGLE_COLOR_BG = "FFFFFF";
Google_color_link = "000000";
Google_color_text = "000000";
google_encoding = "GB2312";
Google_ad_channel = "5161927073";
Google_box_len = 40;
Google_logo_pos = "Left";
Google_rs_pos = "below";
Google_ad_height = 65;
Google_ad_width = 500;
-->
</script>
<script type= "Text/javascript"
src= "Http://pagead2.googlesyndication.com/pagead/show_sdo.js" >
</script>

</td>
</tr>
</table>
</div>
<div class= "Footer" >
<p class= "link" >
Website copyright Information and Disclaimer
</p>

<p class= "Powered" >
Copyright <a href= "http://down.111cn.net" title= "target=" _blank "><strong>down.<span>111cn.net" </span></strong></a> &copy; 2004-2008 INC.
<script language= "javascript" src= "/js/count.js" ></script>
</p><!--/powered-->

</div>
<div id= "tt" ></div>

</body>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.