|
 |
|
รบกวนถามเรื่องเวลา ค่ะ - พอดี ทำโปรเจค เกี่ยวกับการประมูลค่ะ นับเวลาเป็นวินาที |
|
 |
|
|
 |
 |
|
พอดี ทำโปรเจค เกี่ยวกับการประมูลค่ะ นับเวลาเป็นวินาที
ประมาณเว็บนี้ค่ะ http://bidleaders.com/ จะนับเวลาถอยหลังทุก ๆ 2 นาที(หากมีผู้มาประมูลใหม่) โดย อิงเวลาจาก server
จะทำเวลา countdown ค่ะ เหมือนเว็บข้างต้น
ต้องทำยังไงค่ะ ลองใช้ ajax ดู แต่ยังทำเวลานับถอยหลัง โดยการกำหนดค่าเวลายังไม่ได้ค่ะ
ช่วยดูหน่อยนะค่ะ
test.html
<html>
<head>
<script language=JavaScript>
var xmlhttp
function Inint_AJAX () {
var xmlhttp = false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlhttp = false;
}
}
if(!xmlhttp && document.createElement){
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function startCallback() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
document.getElementById("time").innerHTML=xmlhttp.responseText; //รับค่ากลับมา
delete xmlhttp;
setTimeout("doStart()", 1000);
}
}
}
function doStart() {
xmlhttp = Inint_AJAX();
var url = "time.php";
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = startCallback;
xmlhttp.send(null);
}
</script>
</head>
<body>
<div id="time"> </div>
<script language=JavaScript>doStart();</script>
</body>
</html>
time.php
<?
$mtime= date("s",mktime(0,0,0,0,0,0) - time());
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
header("content-type: application/x-javascript; charset=tis-620");
echo "$mtime";
?>
รบกวนผู้รู้ ช่วยดู หน่อยค่ะ ด่วนมาก
ใครพอมีแนวทางหรือตัวอย่าง ช่วยด้วยนะค่ะ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-03-03 00:17:15 |
By :
kookkik |
View :
1759 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำให้น้องๆ โปรเจคประมูลเหมือนกันเลย แต่ว่าไม่ใช่ นับเวลาถอยหลัง 2 นาที ถ้ามีคนมาประมูล แล้วถ้าเกิดมันไม่มีผู้มาประมูลอ่ะคับ จะทำยังไง งง
ที่ทำไว้เป้นแค่ เคาดาวน์ถอยหลังตามระยะเวลาที่ตั้งไว้เฉยๆ ว่าสินค้านี้ประมูลเมื่อไหร่ หมดวันไหน นับจากวันนี้เหลืออีกกี่วัน กี่ชั่วโมง กี่นาที กี่วินาที
แต่ถ้าเอา ถอยหลังทุก 2 นาที ก็ทำการ UPDATE เวลา ตอนบันทึกราคาผู้ประมูล ก็น่าจะได้มั้ง
ยังไงก้ถ้ายังไม่มีใครมาหาวิธีดีๆให้ได้ แอดมาขอได้ที่ msn : [email protected] (ปล. แอดมาก่อน ส่งเมลล์มาขอนะคับ ไม่งั้นเมลไม่ถึง เพราะดักสแปมไว้ หรือขอทาง msn จะสะดวกกว่า ภายนอกเวลาทำการปกติ ) เผื่อจะเอาไปใช้ประโยชน์ได้มั่ง
|
 |
 |
 |
 |
Date :
2009-03-03 01:29:00 |
By :
zankumuro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คือ 2 นาที เป็นตัวอย่างนะค่ะ คงนานกว่านั้น ถ้าไม่มีผู้มาประมูลก็ ให้สิ้นสุดการประมูลอะค่ะ
แอดไปแล้วนะค่ะ ขอบคุณค่ะ
|
 |
 |
 |
 |
Date :
2009-03-03 01:41:29 |
By :
kookkik |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยินดีรับใช้ ลองส่งเมลมานะ
|
 |
 |
 |
 |
Date :
2009-03-03 07:49:28 |
By :
ทีม |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|