|
 |
|
จะกำหนด Header() อย่างไร ในการกำหนดให้เวลาดาวโหลดไฟล์รูปเเล้วpopup ให้เซฟอัตโนมัติ |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
header('Content-Disposition: attachment; filename="test.txt"');
readfile('test.txt');
?>
อันนี้ Text file ครับ
|
 |
 |
 |
 |
Date :
2010-11-13 15:32:28 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
วางไว้ตรงไหนครับ คุณพี่วิน
|
 |
 |
 |
 |
Date :
2010-11-13 15:42:25 |
By :
51035354 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
บนสุดครับ
|
 |
 |
 |
 |
Date :
2010-11-13 15:55:20 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<html>
<head>
<meta http-equiv="refresh" content="10">
<?php
session_start();
// เช็คว่า User ได้ผ่านการ Login มาหรือไม่ (ถ้าไม่ได้ Login มาให้ส่งต่อไปหน้าไหนก็ใส่ URL ลงไปครับ ตรงตำแหน่ง login.php)
if (!isset($_SESSION[login])) {
header("Location: index.php?p=log");
exit;
}
?>
?>
<title>ข้อความทั้งหมด</title>
<style type="text/css">
<!--
body {
background-image: url();
text-decoration: none;
background-repeat: repeat;
color: #000000;
}
.style9 {color: #0000FF; font-size: 14px; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body>
<div align="center">
<p>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("webboard");
mysql_query("SET NAMES TIS620"); //**************
$strSQL = "SELECT * FROM board ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 15; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=5;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL .=" order by webboard_id DESC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
</p>
<table width="1392" border="0">
<tr bgcolor="#FFCC66">
<th width="73"> <div align="center" class="style9">ลำดับที่ </div></th>
<th width="677"> <div align="center" class="style9">ข้อความ </div></th>
<th width="192"> <div align="center" class="style9">ไฟล์เเนบ </div></th
><th width="149"> <div align="center" class="style9">วันที่-เวลา </div></th>
<th width="135"> <div align="center" class="style9">เเจ้งโดย </div></th>
<th width="126"> <div align="center" class="style9">เเผนก </div></th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><?=$objResult["webboard_id"];?></div></td>
<td><?=$objResult["detail"];?></td>
[color=blue] <td><a href="myfile/<?=$objResult["FilesName"];?>"><?=$objResult["FilesName"];?></td> <td><div align="center"><?=$objResult["postdate"];?></td>
<td><div align="center"><?=$objResult["post"];?></div></td>
<td align="center"><?=$objResult["address"];?></td>
</tr>
<?
}
?>
</table>
<br>
ทั้งหมด<?= $Num_Rows;?>
Record :
<?=$Num_Pages;?>
หน้า :
<?
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> ";
}
mysql_close($objConnect);
?>
</div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</body>
</html>
บนสุด????? ไม่ได้ครับ ใส่ไปเเล้วมันให้โหลดไฟล์textเลย งง
|
 |
 |
 |
 |
Date :
2010-11-13 16:10:24 |
By :
51035354 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|