|
 |
|
ช่วยดูโค้ดให้หน่อยนะค่ะ...ใครมีวิธีไหนจะลองใช้หมดเลยค่ะ |
|
 |
|
|
 |
 |
|
เปลี่ยนจาก type="Submit" เป็น type="Button"
|
 |
 |
 |
 |
Date :
2009-08-13 10:36:51 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ได้น่ะค่ะ button เปลี่ยน ทีละไฟล์ก็ไม่ได้ เปลี่ยนทั้ง 2 ก็ไม่ได้น่ะค่ะ
ทำยังไงต่อดีค่ะ แบบนี้?????
|
 |
 |
 |
 |
Date :
2009-08-13 12:11:49 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
XXX.php
Code (PHP)
<?php
<span id="pendule" style="position:absolute;left:10;top:115;"></span>
<script LANGUAGE="JavaScript">
function clock() {
if (!document.layers && !document.all) return;
var digital = new Date();
var hours = digital.getHours();
var minutes = digital.getMinutes();
var seconds = digital.getSeconds();
var amOrPm = "AM";
if (hours > 11) amOrPm = "PM";
if (hours > 12) hours = hours - 12;
if (hours == 0) hours = 12;
if (minutes <= 9) minutes = "0" + minutes;
if (seconds <= 9) seconds = "0" + seconds;
dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
if (document.layers) {
document.layers.pendule.document.write(dispTime);
document.layers.pendule.document.close();
}
else
if (document.all)
pendule.innerHTML = dispTime;
setTimeout("clock()", 1000);
}
startday = new Date();
clockStart = startday.getTime();
function initStopwatch()
{
var myTime = new Date();
var timeNow = myTime.getTime();
var timeDiff = timeNow - clockStart;
this.diffSecs = timeDiff/1000;
return(this.diffSecs);
}
function getSecs()
{
var mySecs = initStopwatch();
var mySecs1 = ""+mySecs;
mySecs1= mySecs1.substring(0,mySecs1.indexOf(".")) + " ";
document.frmMain.timespent.value = mySecs1
window.setTimeout('getSecs()',1000);
}
// End -->
</script>
<form action="YY.php" method="post" name="frmMain" id="frmMain">
<b><br>
คุณอยู่ในหน้านี้มานาน:
<input size=9 name=timespent> วินาที
<input type="submit" name="Submit" value="Submit" onClick="JavaScript:clock();">
</form></b>
<?
echo "<b>SubmitTime :</b>".$timespent."<BR>";
?>
?>
ZZ.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>
</head>
<BODY onLoad="clock() & window.setTimeout('getSecs()',1)">
<?
include "XXX.php";
?>
<form action="YY.php" method="post" name="Myfrm" >
<input type="button" name="Submit" value="Submit" onClick="JavaScript:clock();">
</form>
</body>
</html>
แบบนี้มั้ง ทำไมต้องใช้ 2 button อะ
|
 |
 |
 |
 |
Date :
2009-08-13 12:35:51 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP) zz.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>
</head>
<body>
<?
include "XXX.php";
?>
<input type="button" name="Button" value="Button" onClick="document.getElementById('frmMain').submit();">
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-08-13 16:24:38 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากเลยนะค่ะ พี่ทั้ง 2 คนเลยค่ะ
เก่งๆจริงๆเลย
ขอให้ถูกหวยทุกงวดนะค่ะ..แต่ถ้าหากถูกมาก็มาแบ่งกันมั่งเน้อ
อิอิ^^ ขอบคุณอีกทีนะค่ะ คราวหน้าจะใช้บริการใหม่ค่ะ
|
 |
 |
 |
 |
Date :
2009-08-13 16:44:13 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตกลงผมคิดถูกหรือเปล่าอะ ถ้าถูกจะได้เฉลยว่าเพราะอะไร ตามที่คิดไว้
|
 |
 |
 |
 |
Date :
2009-08-13 16:54:58 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รับขนมจีบ ซาลาเปา เพิ่มมั้ยครับ 
|
 |
 |
 |
 |
Date :
2009-08-13 18:00:21 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ้าว ทำงานเซเว่นหรอเนี้ย เพิ่งรู้ 
|
 |
 |
 |
 |
Date :
2009-08-13 19:51:26 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้โค้ดของพี่ A-mac น่ะค่ะตรงตามความต้องการจริงๆ^^
|
 |
 |
 |
 |
Date :
2009-08-14 14:02:16 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แต่ก็ว่าอีกนั้นแหละค่ะ...อีกนิดนะค่ะ
ถ้าหากจะให้การกำหนด action ไว้ในหน้า ZZ.php ล่ะค่ะทำได้หรือป่าวค่ะ????
|
 |
 |
 |
 |
Date :
2009-08-14 14:50:29 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
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=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<?
include "XXX.php";
?>
<input type="button" name="Button" value="Button" onClick="zz_submit()">
<script>
function zz_submit()
{
frm = document.getElementById('frmMain');
frm.action = "page.php'
frm.submit();
}
</script>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-08-14 15:07:48 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
frm.action = "page.php"; 
|
 |
 |
 |
 |
Date :
2009-08-14 15:08:37 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณค่ะ..นี่เค้าเรียกว่าการใช้การผสม php กะ คำสั่งตัวแปรของ script หรือป่าวค่ะ
ไม่เคยได้เรียนแบบนี้น่ะค่ะ เลยไม่รู้
แต่ก็ขอบคุณอีกทีนะค่ะ
|
 |
 |
 |
 |
Date :
2009-08-14 16:28:12 |
By :
krataiss |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เค้าเรียก DOM ครับ
|
 |
 |
 |
 |
Date :
2009-08-14 16:57:11 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|