Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > PHP > PHP Forum > อยากทราบว่าทำไมถึงติดลบค่ะ แล้ววิธีแก้ควรแก้อย่างไร


[PHP] อยากทราบว่าทำไมถึงติดลบค่ะ แล้ววิธีแก้ควรแก้อย่างไร

 
Topic : 073952



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์



Code (PHP)
01.<?php
02.function DateToTimestamp($date_){
03.// เป็นฟังก์ชั่น ที่จะทำวันเวลาไปเป็นฟังก์ชั่น mktime
04.$sh_=explode("/",$date_);
05.$Sec_=date("s");
06.$timeStamp_=mktime($sh_[3],$sh_[4],$Sec_,$sh_[1],$sh_[0],$sh_[2]);
07.return $timeStamp_;
08.}
09.$show_start=$start_d."/".$start_m."/".$start_y."/".$start_h."/".$start_M; //นำค่าวันเวลาที่ เริ่มต้นมาเก็บไว้ในตัวแปร
10.$timestamp=DateToTimestamp($show_start);//แปลงค่าให้เป็นฟังก์ชั่น mktime
11.$show_end=$end_d."/".$end_m."/".$end_y."/".$end_h."/".$end_M;//นำค่าวันเวลาที่ สิ้นสิ้นมาเก็บไว้ในตัวแปร
12.$timestampa=DateToTimestamp($show_end);//แปลงค่าให้เป็นฟังก์ชั่น mktime
13.$test=$timestampa-$timestamp; //นำเวลาเริ่ม กับสิ้นสุดมาลบกันก็จะได้เวลา ที่จะนับถ้อยหลัง
14.$num=$test;
15.$s=date("s",$num);
16.$m=$num/60;
17.echo $test=$m.":".$s;
18.?>
19.<html>
20.<head>
21.<title>Untitled Document</title>
22.<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
23.</head>
24.<body onLoad="begintimer()">
25.<script language="">
26.var limit="<? echo $test; ?>"
27.if (document.images){
28.var parselimit=limit.split(":")
29.parselimit=parselimit[0]*60+parselimit[1]*1
30.}
31.function begintimer(){
32.if (!document.images)
33.return
34.if (parselimit==1)
35.// เหตุการณ์ที่ต้องการให้เกิดขึ้น
36.// window.location='page.php'; ถ้าต้องการให้กระโดดไปยัง Page อื่น
37.alert("Time Over");
38.else{
39.parselimit-=1
40.curmin=Math.floor(parselimit/60)
41.cursec=parselimit%60
42.if (curmin!=0)
43.curtime="เวลาที่เหลือ <font color=red> "+curmin+" </font>นาที กับ <font color=red>"+cursec+" </font>วินาที "
44.else
45.if(cursec==0)
46.{
47.alert('หมดเวลาแล้วจ้า');
48.}
49.else
50.{
51.curtime="เวลาที่เหลือ <font color=red>"+cursec+" </font>วินาที "
52.}
53.document.getElementById('dplay').innerHTML = curtime;
54.setTimeout("begintimer()",1000)
55.}
56.}
57.//-->
58.</script>
59.<div id=dplay ></div>
60.<form name="frmTest" action="check.php">
61.</form>




Tag : PHP, MySQL

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-16 13:12:06 By : rungjanjira View : 1640 Reply : 8
 

 

No. 1



โพสกระทู้ ( 3,750 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

ลองดูสมาการครับ ถ้าหากติดลบก็ให้สลับตำแหน่งดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 13:26:04 By : Dragons_first
 

 

No. 2



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


ลองสลับแล้วค่ะ ถ้าสลับเป็น 1 เฉยๆ ก็จะไม่นับ แต่จะขึ้น alert เป็น time over เลยค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 13:29:53 By : rungjanjira
 

 

No. 3



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


ค่าตรงนี้อ่ะ parselimit-=1 ไม่รู้จะแก้ไง เคยมีพี่เค้าแก้ให้ได้แล้วค่ะ แต่พอดีโน๊ตบุ๊คโดนขโมยเลยข้อมูลโปรเจคหายทั้งหมดค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 13:31:35 By : rungjanjira
 

 

No. 4



โพสกระทู้ ( 144 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ที่มันไม่ได้เพราะว่า

$show_start กับ $show_end มันไม่มีค่าครับ

ดูบรรทัดที่ 10-11 กับ 14-15 นะครับ ผมทดลองให้แล้ว

Code (PHP)
01.<?php
02.function DateToTimestamp($date_){
03.// เป็นฟังก์ชั่น ที่จะทำวันเวลาไปเป็นฟังก์ชั่น mktime
04.$sh_=explode("/",$date_);
05.$Sec_=date("s");
06.$timeStamp_=mktime($sh_[3],$sh_[4],$Sec_,$sh_[1],$sh_[0],$sh_[2]);
07.return $timeStamp_;
08.}
09. 
10.//$show_start=$start_d."/".$start_m."/".$start_y."/".$start_h."/".$start_M; //นำค่าวันเวลาที่ เริ่มต้นมาเก็บไว้ในตัวแปร
11.$show_start="2012/2/16/10/15";
12. 
13.$timestamp=DateToTimestamp($show_start);//แปลงค่าให้เป็นฟังก์ชั่น mktime
14.//$show_end=$end_d."/".$end_m."/".$end_y."/".$end_h."/".$end_M;//นำค่าวันเวลาที่ สิ้นสิ้นมาเก็บไว้ในตัวแปร
15.$show_end="2012/2/16/10/30";
16. 
17.$timestampa=DateToTimestamp($show_end);//แปลงค่าให้เป็นฟังก์ชั่น mktime
18.$test=$timestampa-$timestamp; //นำเวลาเริ่ม กับสิ้นสุดมาลบกันก็จะได้เวลา ที่จะนับถ้อยหลัง
19.$num=$test;
20. 
21.$s=date("s",$num);
22.$m=$num/60;
23.echo $test=$m.":".$s;
24.?>
25.<html>
26.<head>
27.<title>Untitled Document</title>
28.<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
29.</head>
30.<body onLoad="begintimer()">
31.<script language="">
32.var limit="<? echo $test; ?>"
33.if (document.images){
34.var parselimit=limit.split(":")
35.parselimit=(parselimit[0]*60)+(parselimit[1]*1)
36.}
37.function begintimer(){
38.if (!document.images)
39.return
40.if (parselimit==1)
41.// เหตุการณ์ที่ต้องการให้เกิดขึ้น
42.// window.location='page.php'; ถ้าต้องการให้กระโดดไปยัง Page อื่น
43.alert("Time Over");
44.else{
45.parselimit-=1
46.curmin=Math.floor(parselimit/60)
47.cursec=parselimit%60
48.if (curmin!=0)
49.curtime="เวลาที่เหลือ <font color=red> "+curmin+" </font>นาที กับ <font color=red>"+cursec+" </font>วินาที "
50.else
51.if(cursec==0)
52.{
53.alert('หมดเวลาแล้วจ้า');
54.}
55.else
56.{
57.curtime="เวลาที่เหลือ <font color=red>"+cursec+" </font>วินาที "
58.}
59.document.getElementById('dplay').innerHTML = curtime;
60.setTimeout("begintimer()",1000)
61.}
62.}
63.//-->
64.</script>
65.<div id=dplay ></div>
66.<form name="frmTest" action="check.php">
67.</form>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 13:35:12 By : 13eachz
 

 

No. 5



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


แล้วถ้าโปรแกรมต้องรับค่าจากฟอร์มนี้หล่ะค่ะ ต้องแก้ยังไงค่ะ

Code (PHP)
001.<html>
002.<head>
003.<title>Untitled Document</title>
004.<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
005.</head>
006.<body>
007.<form name="form1" method="post" action="test.php">
008.<table width="100%" cellspacing="0" cellpadding="0">
009.<tr>
010.<td><table cellspacing="1" cellpadding="1">
011.<tr>
012.<td width="73"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">&nbsp;</font></td>
013.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">วันที่</font></div></td>
014.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เดือน</font></div></td>
015.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">ปี
016.( พ.ศ. )</font></div></td>
017.<td width="47"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">ชั่วโมง</font></div></td>
018.<td width="41"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">นาที</font></div></td>
019.</tr>
020.<tr>
021.<td height="26"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เวลาเริ่มกิจกรรม</font></td>
022.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
023.<select name="start_d" id="start_d">
024.<option value="0">เลือก</option>
025.<?
026.for($d=1;$d<=31;$d++)
027.{
028.?>
029.<option value="<? echo $d; ?>"><? echo $d; ?></option>
030.<?
031.}
032.?>
033.</select>
034.</font></strong></td>
035.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
036.<select name="start_m" id="start_m">
037.<option value="0">เลือก</option>
038.<?
039.for($d=1;$d<=12;$d++)
040.{
041.?>
042.<option value="<? echo $d; ?>"><? echo $d; ?></option>
043.<?
044.}
045.?>
046.</select>
047.</font></strong></td>
048.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
049.<select name="start_y" id="select2">
050.<option value="0">เลือก</option>
051.<?
052.$Tyear=date("Y")+543;
053.for($d=2550;$d<=$Tyear;$d++)
054.{
055.?>
056.<option value="<? echo $d-543; ?>"><? echo "พ.ศ. ".$d; ?></option>
057.<?
058.}
059.?>
060.</select>
061.</font></strong></td>
062.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
063.<select name="start_h" id="start_h">
064.<option value="0">0</option>
065.<?
066.for($d=1;$d<=24;$d++)
067.{
068.?>
069.<option value="<? echo $d; ?>"><? echo $d; ?></option>
070.<?
071.}
072.?>
073.</select>
074.: </font></strong></td>
075.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
076.<select name="start_M" id="select">
077.<option value="0">00</option>
078.<?
079.for($i=1;$i<=59;$i++)
080.{
081.?>
082.<option value="<? echo $i; ?>"><? echo $i; ?></option>
083.<?
084.}
085.?>
086.</select>
087.</font></strong></td>
088.</tr>
089.<tr>
090.<td height="26"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เวลาจบกิจกรรม</font></td>
091.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
092.<select name="end_d" id="end_d">
093.<option value="0">เลือก</option>
094.<?
095.for($d=1;$d<=31;$d++)
096.{
097.?>
098.<option value="<? echo $d; ?>"><? echo $d; ?></option>
099.<?
100.}
101.?>
102.</select>
103.</font></strong></td>
104.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
105.<select name="end_m" id="end_m">
106.<option value="0">เลือก</option>
107.<?
108.for($d=1;$d<=12;$d++)
109.{
110.?>
111.<option value="<? echo $d; ?>"><? echo $d; ?></option>
112.<?
113.}
114.?>
115.</select>
116.</font></strong></td>
117.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
118.<select name="end_y" id="end_y">
119.<option value="0">เลือก</option>
120.<?
121.for($d=2550;$d<=$Tyear;$d++)
122.{
123.?>
124.<option value="<? echo $d-543; ?>"><? echo "พ.ศ. ".$d; ?></option>
125.<?
126.}
127.?>
128.</select>
129.</font></strong></td>
130.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
131.<select name="end_h" id="end_h">
132.<option value="0">0</option>
133.<?
134.for($d=1;$d<=24;$d++)
135.{
136.?>
137.<option value="<? echo $d; ?>"><? echo $d; ?></option>
138.<?
139.}
140.?>
141.</select>
142.: </font></strong></td>
143.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
144.<select name="end_M" id="select">
145.<option value="0">00</option>
146.<?
147.for($i=1;$i<=59;$i++)
148.{
149.?>
150.<option value="<? echo $i; ?>"><? echo $i; ?></option>
151.<?
152.}
153.?>
154.</select>
155.</font></strong></td>
156.</tr>
157.<tr>
158.<td height="26" colspan="6"><div align="center">
159.<input type="submit" name="Submit" value="Submit">
160.</div></td>
161.</tr>
162.</table></td>
163.</tr>
164.</table>
165.</form>
166.</body>
167.</html>



ประวัติการแก้ไข
2012-02-16 13:55:42
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 13:50:37 By : rungjanjira
 

 

No. 6



โพสกระทู้ ( 144 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

บรรทัดที่ 10-11
Code (PHP)
1.$show_start="$_POST[start_d]/$_POST[start_m]/$_POST[start_y]/$_POST[start_h]/$_POST[start_M]";



บรรทัดที่ 14-15
Code (PHP)
1.$show_end="$_POST[end_d]/$_POST[end_m]/$_POST[end_y]/$_POST[end_h]/$_POST[end_M]";



ใช้ 2 ตัวนี้แทนลงไปครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 14:03:52 By : 13eachz
 

 

No. 7



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


พี่ช่วยอธิบายโค้ดให้ฟังหน่อยได้ไหมค่ะ แล้วพี่แก้ตรงไหนบ้างทำไมตอนหนูทำถึงไม่ได้อ่ะค่ะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 14:16:56 By : rungjanjira
 

 

No. 8



โพสกระทู้ ( 144 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ไม่ได้แก้อะไรเลยครับ
แค่ใช้
$show_start="$_POST[start_d]/$_POST[start_m]/$_POST[start_y]/$_POST[start_h]/$_POST[start_M]";

ให้ #show_start รับค่าจากฟอร์มจากหน้าที่แล้ว ตาม action คือ POST $_POST[start_M] ในลักษณะนี้ครับ
แล้วก็เรียงลำดับ เป็น ปี เดือน วัน ชั่วโมง นาที แล้ว แยก ด้วย /

ผมเอาโค้ดให้เลยละกันครับ

form_time.php
Code (PHP)
001.<html>
002.<head>
003.<title>Untitled Document</title>
004.<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
005.</head>
006.<body>
007.<form name="form1" method="post" action="test_time.php"> // เลือกเอานะครับว่าจะให้ action ไปที่ไหน
008.<table width="100%" cellspacing="0" cellpadding="0">
009.<tr>
010.<td><table cellspacing="1" cellpadding="1">
011.<tr>
012.<td width="73"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">&nbsp;</font></td>
013.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">วันที่</font></div></td>
014.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เดือน</font></div></td>
015.<td width="58"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">ปี
016.( พ.ศ. )</font></div></td>
017.<td width="47"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">ชั่วโมง</font></div></td>
018.<td width="41"><div align="center"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">นาที</font></div></td>
019.</tr>
020.<tr>
021.<td height="26"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เวลาเริ่มกิจกรรม</font></td>
022.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
023.<select name="start_d" id="start_d">
024.<option value="0">เลือก</option>
025.<?
026.for($d=1;$d<=31;$d++)
027.{
028.?>
029.<option value="<? echo $d; ?>"><? echo $d; ?></option>
030.<?
031.}
032.?>
033.</select>
034.</font></strong></td>
035.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
036.<select name="start_m" id="start_m">
037.<option value="0">เลือก</option>
038.<?
039.for($d=1;$d<=12;$d++)
040.{
041.?>
042.<option value="<? echo $d; ?>"><? echo $d; ?></option>
043.<?
044.}
045.?>
046.</select>
047.</font></strong></td>
048.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
049.<select name="start_y" id="select2">
050.<option value="0">เลือก</option>
051.<?
052.$Tyear=date("Y")+543;
053.for($d=2550;$d<=$Tyear;$d++)
054.{
055.?>
056.<option value="<? echo $d-543; ?>"><? echo "พ.ศ. ".$d; ?></option>
057.<?
058.}
059.?>
060.</select>
061.</font></strong></td>
062.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
063.<select name="start_h" id="start_h">
064.<option value="0">0</option>
065.<?
066.for($d=1;$d<=24;$d++)
067.{
068.?>
069.<option value="<? echo $d; ?>"><? echo $d; ?></option>
070.<?
071.}
072.?>
073.</select>
074.: </font></strong></td>
075.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
076.<select name="start_M" id="select">
077.<option value="0">00</option>
078.<?
079.for($i=1;$i<=59;$i++)
080.{
081.?>
082.<option value="<? echo $i; ?>"><? echo $i; ?></option>
083.<?
084.}
085.?>
086.</select>
087.</font></strong></td>
088.</tr>
089.<tr>
090.<td height="26"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">เวลาจบกิจกรรม</font></td>
091.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
092.<select name="end_d" id="end_d">
093.<option value="0">เลือก</option>
094.<?
095.for($d=1;$d<=31;$d++)
096.{
097.?>
098.<option value="<? echo $d; ?>"><? echo $d; ?></option>
099.<?
100.}
101.?>
102.</select>
103.</font></strong></td>
104.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
105.<select name="end_m" id="end_m">
106.<option value="0">เลือก</option>
107.<?
108.for($d=1;$d<=12;$d++)
109.{
110.?>
111.<option value="<? echo $d; ?>"><? echo $d; ?></option>
112.<?
113.}
114.?>
115.</select>
116.</font></strong></td>
117.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
118.<select name="end_y" id="end_y">
119.<option value="0">เลือก</option>
120.<?
121.for($d=2550;$d<=$Tyear;$d++)
122.{
123.?>
124.<option value="<? echo $d-543; ?>"><? echo "พ.ศ. ".$d; ?></option>
125.<?
126.}
127.?>
128.</select>
129.</font></strong></td>
130.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
131.<select name="end_h" id="end_h">
132.<option value="0">0</option>
133.<?
134.for($d=1;$d<=24;$d++)
135.{
136.?>
137.<option value="<? echo $d; ?>"><? echo $d; ?></option>
138.<?
139.}
140.?>
141.</select>
142.: </font></strong></td>
143.<td><strong><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
144.<select name="end_M" id="select">
145.<option value="0">00</option>
146.<?
147.for($i=1;$i<=59;$i++)
148.{
149.?>
150.<option value="<? echo $i; ?>"><? echo $i; ?></option>
151.<?
152.}
153.?>
154.</select>
155.</font></strong></td>
156.</tr>
157.<tr>
158.<td height="26" colspan="6"><div align="center">
159.<input type="submit" name="Submit" value="Submit">
160.</div></td>
161.</tr>
162.</table></td>
163.</tr>
164.</table>
165.</form>
166.</body>
167.</html>



อันนี้หน้า test_time.php
Code (PHP)
01.<?php
02.function DateToTimestamp($date_){
03.// เป็นฟังก์ชั่น ที่จะทำวันเวลาไปเป็นฟังก์ชั่น mktime
04.$sh_=explode("/",$date_);
05.$Sec_=date("s");
06.$timeStamp_=mktime($sh_[3],$sh_[4],$Sec_,$sh_[1],$sh_[0],$sh_[2]);
07.return $timeStamp_;
08.}
09. 
10.$show_start="$_POST[start_d]/$_POST[start_m]/$_POST[start_y]/$_POST[start_h]/$_POST[start_M]";
11.$timestamp=DateToTimestamp($show_start);//แปลงค่าให้เป็นฟังก์ชั่น mktime
12. 
13.$show_end="$_POST[end_d]/$_POST[end_m]/$_POST[end_y]/$_POST[end_h]/$_POST[end_M]";
14.$timestampa=DateToTimestamp($show_end);//แปลงค่าให้เป็นฟังก์ชั่น mktime
15. 
16.$test=$timestampa-$timestamp; //นำเวลาเริ่ม กับสิ้นสุดมาลบกันก็จะได้เวลา ที่จะนับถ้อยหลัง
17.$num=$test;
18. 
19.$s=date("s",$num);
20.$m=$num/60;
21.echo $test=$m.":".$s;
22.?>
23.<html>
24.<head>
25.<title>Untitled Document</title>
26.<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
27.</head>
28.<body onLoad="begintimer()">
29.<script language="">
30.var limit="<? echo $test; ?>"
31.if (document.images){
32.var parselimit=limit.split(":")
33.parselimit=(parselimit[0]*60)+(parselimit[1]*1)
34.}
35.function begintimer(){
36.if (!document.images)
37.return
38.if (parselimit==1)
39.// เหตุการณ์ที่ต้องการให้เกิดขึ้น
40.// window.location='page.php'; ถ้าต้องการให้กระโดดไปยัง Page อื่น
41.alert("Time Over");
42.else{
43.parselimit-=1
44.curmin=Math.floor(parselimit/60)
45.cursec=parselimit%60
46.if (curmin!=0)
47.curtime="เวลาที่เหลือ <font color=red> "+curmin+" </font>นาที กับ <font color=red>"+cursec+" </font>วินาที "
48.else
49.if(cursec==0)
50.{
51.alert('หมดเวลาแล้วจ้า');
52.}
53.else
54.{
55.curtime="เวลาที่เหลือ <font color=red>"+cursec+" </font>วินาที "
56.}
57.document.getElementById('dplay').innerHTML = curtime;
58.setTimeout("begintimer()",1000)
59.}
60.}
61.//-->
62.</script>
63.<div id=dplay ></div>
64.<form name="frmTest" action="check.php">
65.</form>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-16 14:26:10 By : 13eachz
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : อยากทราบว่าทำไมถึงติดลบค่ะ แล้ววิธีแก้ควรแก้อย่างไร
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่