|
|
|
ถึงคุณ arsachi header("Content-type: $type"); เปลี่ยนเป็น อย่างนี้ header("Content-$type: $type"); เหรอค่ะ ถูกรึป่าว |
|
|
|
|
|
|
|
แล้วใครจะกล้าตอบงิ = =
|
|
|
|
|
Date :
21 เม.ย. 2551 17:28:26 |
By :
= =' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ก็คงต้องรอ คนที่เค้าถาม ละครับ ถ้าเค้าไม่มา ก็ จม อยู่นั่นละ
|
|
|
|
|
Date :
21 เม.ย. 2551 17:33:09 |
By :
อืม |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อ่อโทษที่ครับ
ไฟล์แรก ที่เรีกใช้ เอเจ้กให้แสดงผลครับผมให้ชื่อว่า
displayajax.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=windows-874" />
<title>Untitled Document</title>
<script language=javascript>
function doajax()
{
var req;
if(window.XMLHttpRequest){
req=new XMLHttpRequest();
}
else if(window.ActiveXObject){
req=new ActiveXObject("Microsoft.XMLHTTP");
}
else{
alert("Browser error");
return false;
}
req.onreadystatechange=function()
{
if(req.readyState==4){
var resultarea=document.getElementById('result');
resultarea.innerHTML=req.responseText;
}
}
req.open("GET","useajax.php?"+ new Date().getTime() + Math.random(),true);
req.send(null);
}
</script>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body onload="doajax();">
<div id="result">result file</div>
</body>
</html>
l-------------------
ส่วนที่สอง เป็นไฟล์ถูกเรียกใช้
useajax.php
<?
header("content-type: application/x-javascript; charset=TIS-620"); //ตรงนี้คือส่วนเฮดเดอร์ ถ้าไม่ส่เมื่อถูกเรียกใช้ จะไม่แสดงผลภาษาไทย
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<? echo "ภาษาไทยแล้วครับ";?>
</body>
</html>
โทษทีตอบช้า เข้มาทุกววันครับแต่ไม่รุ้ช่วงไหนแล้วแต่ว่าง
แต่เข้าครับ
|
|
|
|
|
Date :
22 เม.ย. 2551 06:10:39 |
By :
arsachi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
งงค่ะ คือว่าของหวานจะเกี่ยวกับการให้มันดาวน์โหลดไฟล์ที่เก็บอยู่ในฐานข้อมูลได้อะค่ะ
แล้วต้องประยุกต์ตรงค่ะไหน คือว่าไม่เข้าใจจิงจิงค่ะ ช่วยแนะนำด้วยนะค่ะ
<?php
include("inc/itConfig.php");
include("inc/itFunction.php");
include("inc/itFunctionDB.php");
include("checksession.php");
if ($ID) {
$strSQL = "SELECT FileNm FROM job WHERE ID='$FileNm'";
/*$strSQL = "INSERT into job (FileNm) VALUES ('$FileNm')";*/
$result = @mysql_query($strSQL, $DataBaseName);
$data = @mysql_result($result, 0, "FileNm");
/*$name = @mysql_result($result, 0, "filename");
$size = @mysql_result($result, 0, "filesize");
$type = @mysql_result($result, 0, "filetype");*/
header("Content-type: $type");
header("Content-length: $size");
header("Content-Disposition: attachment; FileNm=$FileNm");
header("Content-Description: PHP Generated Data");
echo $strSQL;
}
?>
|
|
|
|
|
Date :
22 เม.ย. 2551 09:15:04 |
By :
oranan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อ่อ งั้นผิดกระทุ้ นึกว่า อันที่เป็นเอเจค เหอๆ
แต่ดาวโหลดก้ทำผ่านเอเจคเหมือนกัน
<?
$sql="select * from tb_download where id_dl='$id_dl' ";
$query=mysql_query($sql);$result=mysql_fetch_array($query);
header("Content-type: ".$result['dl_type']);
header('Content-Disposition: attachment; filename='.$result[dl_data]);
readfile('image/news/$result[dl_data]');
?>
|
|
|
|
|
Date :
22 เม.ย. 2551 11:15:02 |
By :
arsachi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|