|
|
|
ลบกวนพี่ๆช่วยหน่อยคับ ขอ code นับจำนวนคนดาวโหลดไฟล์หน่อยคับ ขอคำอธิบายด้วยนะคับ |
|
|
|
|
|
|
|
ลบกวนหน่อยนะคับ
นี้เป็นcode download ของผม
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.newmai1 {background-color: #FFC;
border: thick ridge #FC6;
color: #000;
}
.hk {
font-size: 14px;
font-weight: bold;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
color: #999;
}
a:active {
text-decoration: none;
}
.gg {
text-align: center;
}
.ws {
font-size: 10px;
color: #F00;
}
.newmai1 tr td table tr td {
font-size: 12px;
}
#form2 table tr .gray-small {
font-size: 14px;
}
-->
</style>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('image/bg_home_2.jpg','image/bg_pu_2.jpg','image/bg_tumneb_2.jpg','image/bg_nuk_2.jpg','image/bg_tun_2.jpg','image/bg_new_2.jpg','image/bg_tamtab_2.jpg','image/bg_load_2.jpg')">
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1000" height="320">
<param name="movie" value="image/web.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="8.0.35.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="image/web.swf" width="1000" height="320">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="8.0.35.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object></td>
</tr>
<tr>
<td colspan="2" valign="top"><a href="index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image14','','image/bg_home_2.jpg',1)"><img src="image/bg_home.jpg" alt="" name="Image14" width="84" height="33" border="0" id="Image14" /></a><a href="executive.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image15','','image/bg_pu_2.jpg',1)"><img src="image/bg_pu.jpg" alt="" name="Image15" width="147" height="33" border="0" id="Image15" /></a><a href="seat1.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','image/bg_tumneb_2.jpg',1)"><img src="image/bg_tumneb.jpg" alt="" name="Image16" width="150" height="33" border="0" id="Image16" /></a><a href="rsc.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image17','','image/bg_nuk_2.jpg',1)"><img src="image/bg_nuk.jpg" alt="" name="Image17" width="130" height="33" border="0" id="Image17" /></a><a href="capital1.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image18','','image/bg_tun_2.jpg',1)"><img src="image/bg_tun.jpg" alt="" name="Image18" width="110" height="33" border="0" id="Image18" /></a><a href="new.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image19','','image/bg_new_2.jpg',1)"><img src="image/bg_new.jpg" alt="" name="Image19" width="133" height="33" border="0" id="Image19" /></a><a href="webboard/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image20','','image/bg_tamtab_2.jpg',1)"><img src="image/bg_tamtab.jpg" alt="" name="Image20" width="147" height="33" border="0" id="Image20" /></a><a href="download.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image21','','image/bg_load_2.jpg',1)"><img src="image/bg_load.jpg" alt="" name="Image21" width="98" height="33" border="0" id="Image21" /></a></td>
</tr>
<tr>
<td colspan="2" valign="top"><table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image/tab.jpg" alt="" width="998" height="42" /></td>
</tr>
</table></td>
</tr>
<tr>
<td width="218" valign="top"><p><img src="image/main_menu.jpg" alt="" width="249" height="437" border="0" usemap="#Map2" />
<map name="Map2" id="Map2">
<area shape="rect" coords="9,60,238,87" href="history.php" />
<area shape="rect" coords="8,91,237,119" href="pruchya.php" />
<area shape="rect" coords="8,121,236,150" href="fabric.php" />
<area shape="rect" coords="8,152,238,180" href="executive.php" />
<area shape="rect" coords="7,184,237,211" href="seat1.php" />
<area shape="rect" coords="8,214,236,242" href="rsc.php" />
<area shape="rect" coords="9,245,237,273" href="capital1.php" />
<area shape="rect" coords="9,277,240,304" href="new.php" />
<area shape="rect" coords="9,308,239,335" href="webboard/index.php" />
<area shape="rect" coords="8,338,239,366" href="download.php" />
<area shape="rect" coords="8,370,239,397" href="know.php" />
<area shape="rect" coords="8,400,240,431" href="pan.php" />
</map>
<br />
</p>
<form id="form1" name="form1" method="post" action="login_check.php">
<table width="247" border="0" cellpadding="5" class="newmai1">
<tr bgcolor="#FFFFFF">
<td colspan="2"> <img src="image/login.jpg" alt="" width="200" height="35" /></td>
</tr>
<tr>
<td width="77" bgcolor="#CCFF99">ชื่อผู้ใช้</td>
<td width="132" bgcolor="#CCFF99"><input name="username" type="text" id="username" size="15" /></td>
</tr>
<tr>
<td bgcolor="#CCFF99">รหัสผ่าน</td>
<td bgcolor="#CCFF99"><input name="password" type="password" id="password" size="15" /></td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCFF99">
<input type="submit" name="button" id="button" value="ตกลง" />
<input type="reset" name="button" id="button2" value="ยกเลิก" /></td>
</tr>
</table>
<br />
</form></td>
<td width="782" valign="top"><br />
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/Hwork.jpg" width="300" height="50" /></td>
</tr>
</table>
<br />
<form id="form2" name="form2" method="post" action="work_searchs.php">
<table width="243" align="center">
<tr>
<td width="90" class="gray-small">ค้นหาโดยชื่อผู้วิจัย</td>
<td width="137"> </td>
</tr>
<tr>
<td><input name="text_search" type="text" id="text_search" size="50" value="<? echo $text_search; ?>"/></td>
<td><input type="image" src="image/search_but.gif" name="search" width="24" height="20" border="0" id="search" onclick="submit"/></td>
</tr>
</table>
</form>
<br />
<br />
<table width="139" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="139" align="right"><a href="download.php">กลับเมนูดาวน์โหลด</a></td>
</tr>
</table>
<br />
<br />
<?php
include("inc/connect_db.php");
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * 10;
$sql = "SELECT * FROM work ORDER BY work_year DESC LIMIT $start_from , 10";
$rs_result = mysql_query($sql);
?>
<table width="728" border="2" align="center" cellpadding="0" cellspacing="0" class="newmai1">
<tr class="hk">
<td width="223" align="center">เรื่อง / หัวข้อวิจัย<br /></td>
<td width="251" align="center">ผู้วิจัย<br /></td>
<td width="75" align="center">บทคัดย่อ</td>
<td width="72" align="center">บทความ<br />
วิชาการ</td>
<td width="85" align="center">งานวิจัย<br />
ฉบับ<br />
สมบูรณ์</td>
</tr>
<tr>
<? while($row = mysql_fetch_assoc($rs_result)){
?>
<td><table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><span class="hk">ไทย :</span>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><? echo $row['work_topname']?> </td>
</tr>
</table></td>
</tr>
<tr>
<td class="hk">English :
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><? echo $row['work_engname']?> </td>
</tr>
</table></td>
</tr>
</table></td>
<td><table width="242" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="242"><? echo $row['work_name']?> </td>
</tr>
<tr>
<td align="center">[ ปี : <? echo $row['work_year']?> ]</td>
</tr>
</table></td>
<td class="more"><? if($row['work_data1']!="") {?>
<a href="docs/work_data/<? echo $row['work_data1']?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('down_bro01<? echo $a; ?>','images/template/deatils.gif',1)"> <img src="images/template/download.gif" alt="" name="down_data01<? echo $a; ?>" width="25" height="25" border="0" id="down_data01<? echo $a; ?>" /></a>
<? } else {?>
<span>
<table width="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" class="gg"> - </td>
</tr>
</table>
</span></a>
<? } ?>
<td class="more"><? if($row['work_data2']!="") {?>
<a href="docs/work_data/<? echo $row['work_data2']?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('down_bro01<? echo $a; ?>','images/template/deatils.gif',1)"> <img src="images/template/download.gif" alt="" name="down_data01<? echo $a; ?>" width="25" height="25" border="0" id="down_data01<? echo $a; ?>" /></a>
<? } else {?>
<span>
<table width="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30" class="gg"> - </td>
</tr>
</table>
</span></a>
<? } ?></td>
<td class="more"><? if($row['work_data3']!="") {?>
<a href="docs/work_data/<? echo $row['work_data3']?>" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('down_bro01<? echo $a; ?>','images/template/deatils.gif',1)"> <img src="images/template/download.gif" alt="" name="down_data01<? echo $a; ?>" width="25" height="25" border="0" id="down_data01<? echo $a; ?>" /></a>
<? } else {?>
<span>
<table width="66" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="66" class="gg"> <span class="ws">ขอสงวนสิทธิ์</span></td>
</tr>
</table>
</span></a>
<? } ?></td>
</tr>
<? } ?>
</table>
<br />
<?php
$sql = "SELECT COUNT(work_ID) FROM work";
$rs_result = mysql_query($sql);
$row = mysql_fetch_row($rs_result);
$total_records = $row[0];
$total_pages = ceil($total_records / 10);
?>
<table align="center">
<tr>
<?
if($total_records >= "10") {
for ($i=1; $i<=$total_pages; $i++) {
if($_GET['page']==$i) {
echo "<td><a href='work.php?page=".$i."' class ='select'>".$i."</a> </td>"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1
}else{
echo "<td><a href='work.php?page=".$i."' class =''>".$i."</a> </td>"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2
}
}
}
?>
</tr>
</table>
<p>
<?
echo '<center><span style="color:#464646 !important;font-family: Verdana, Geneva, sans-serif !important;font-size: 13px !important;">มีทั้งหมด '.$total_records.' รายการ</span></center>';
?>
<p> </p></td>
</tr>
<tr>
<td colspan="2"><img src="image/addtay.jpg" alt="" width="1000" height="100" /></td>
</tr>
</table>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>
Tag : PHP
|
|
|
|
|
|
Date :
2011-08-08 12:05:12 |
By :
domedogs |
View :
1448 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อีกบทความครับ
<a href="phts/download.php?id=xxxx"> ดาวน์โหลด </a>
download.php
//** Update Count ***//
$strSQL = "UPDATE files SET Download = Download + 1 WHERE id = '".$_GET["id"]."' ";
$objQuery = mysql_query($strSQL);
$strSQL = "SELECT * FROM files WHERE id = '".$_GET["id"]."' ";
$objQuery = mysql_query($strSQL);
$result = mysql_fetch_array($objQuery);
header("location:".$result["FilePath"]);
exit();
|
|
|
|
|
Date :
2011-08-08 13:15:38 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลบกวน เขียนผิดครับ
|
|
|
|
|
Date :
2011-08-08 13:23:51 |
By :
attaprawat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณคับเดียวลองดูนะคับ
|
|
|
|
|
Date :
2011-08-08 15:06:11 |
By :
dome |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|