| 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ง๊าบบบบบบบบบบบ เจ๋งจิงๆ 
 อยากเก่งแบบนี้บ้าง = =
 
 ฝากตัวด้วยนะครับ
 
 เด๋วคงมีปัญหามาถามบ่อยๆ เพราะตอนนี้กำลังฝึกงาน
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 12:59:20 | By :
                            torrider |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ดีครับ เก่งมากมาย ไม่มีคำติครับ มีแต่คำชม ช่วยๆ กันตอบครับ เด็กแถวนี้ปัญหาใหญ่ คือ ถามไม่ค่อยเป็น แต่เราก็พยายามตอบนะ
  
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 13:17:27 | By :
                            plakrim |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | สวยงามมากครับ ผมก็เริ่มศึกษาเหมือนกันนะครับ โปรแกรมเมอร์สมัครเล่นนะครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 14:40:44 | By :
                            boongerd |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เดียวผมว่าง เอาตัวอย่าง Ajax ที่ใช้งานจิงๆ มาให้ทดลองเล่นกันนะครับ 
 ผมไม่ห่วง code อยู่แล้วมีอะไรปรึกษาได้ครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 15:03:47 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ขอบคุณล่วงหน้าสำรับคำแนะนำ เพราะต้องถามมากมายแน่ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 15:13:04 | By :
                            kai9 |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | งั้นจะให้พี่ช่วยตอบคำถามไม่เกรงใจแล้วนะค่ะพี่ชาย 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 16:09:45 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | พี่ค่ะ ปอนด์ถามไรหน่อยดิ พี่มีโค้ดสมัครสมาชิกฝ่านpdaป่ะ ใช้oracelนะ ใช่odbcค่ะ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 16:15:55 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ไม่มี code หรอนะแต่ว่า เขียน เป็น code อ่ะได้ครับ 
 เพราะว่าหลักการเดียวกัน อ่ะครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 16:38:13 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เรื่องpdaถามให้เพื่อนนะค่ะพี่ 
 พี่ค่ะ ถามเรื่องโค้ดหน่อยค่ะ
 ช่วยดูให้หน่อยนะค่ะ ถ้าแก้ให้เลยก็ดีค่ะ อิอิ ขอบคุณค่ะพี่
 
 
 
 
 
 Code (PHP)
 อันนี้จะเป็ฯในส่วนของการดึงโชว์และดึงมาจากฐานข้อมูล
 
 
 <?php
<? 
  
include "connect_odbc.php"; 
//include "function.php"; 
$stmt = oci_parse($conn,  "SELECT * FROM room "); 
oci_execute($stmt); 
    //$i = 1; 
        while ($row = oci_fetch_array ($stmt, OCI_NUM)) { 
            $room_floor= $row[1]; 
               $room_id= $row[0]; 
            $room_sit= $row[4];  
             
             
            $room_floor=htmlspecialchars($room_floor); 
            //$name_ques=htmlspecialchars($name_ques); 
             
            //$detail_ques=nl2br(htmlspecialchars($detail_ques)); 
        /*    $date_ques=displaydate($date_ques); <td width="360" class="style31"><? echo "<a href='answer_view.php?id_ques=$id_ques'> $title_ques </a>"; ?></td>*/ 
?> 
                 <table width="641"> 
                    <tr bgcolor="#e0eff8"> 
                      <td width="60" class="style31"><? echo $room_floor; ?></td> 
                      <td width="100" class="style31"><? echo $room_id; ?></td> 
                      <td width="80" class="style31"><? echo $room_sit; ?></td> 
                    </tr> 
                 </table> 
                 <? } ?> 
?>
 
 
 Code (PHP)
 อันนี้มีพีเขาแนะมาค่ะ แต่เอามาดัดแปลงไม่ถูก แก้ตั้งนานก็ยังไม่ได้สักที และก็โค้ดแสดงสถานะ แต่เอามาใส่ไม่ถูกค่ะ
 
 <?php
<?
$sql = "SELECT *  from tbl_room order by room_id"; 
$result = mysql_query($sql); 
$numsrow = mysql_num_rows($result); 
?> 
        <tbody> 
          <tr> 
            <td width="3%" class="tbl2" style="white-space: nowrap;"><div align="center" class="style2">NO</div></td> 
            <td width="40%"  valign="top" class="style3" style="white-space: nowrap;">ห้อง</td> 
            <td width="6%" align="center"  valign="top" class="style3" style="white-space: nowrap;">สถานะ</td> 
            <td width="4%" class="tbl2" style="white-space: nowrap;"><div align="center" class="style2">NO</div></td> 
            <td width="40%"  valign="top" class="style3" style="white-space: nowrap;">ห้อง</td> 
            <td width="7%" align="center"  valign="top" class="style3" style="white-space: nowrap;">สถานะ</td> 
          </tr> 
          <?php 
$column = 2; 
$ic =1; 
for ($i=1; $i<=$numsrow;$i++){ 
$r=mysql_fetch_array($result); 
$room_id = $r['room_id']; 
$room_status = $r['room_status']; 
$room_type = $r['room_type']; 
if ($ic ==1) { 
?> 
          <tr> 
            <?php } ?> 
            <td  class="tbl2" style="white-space: nowrap;"><div align="center"><?=$room_id?> 
            </div></td> 
            <td  class="tbl1" style="white-space: nowrap;"><?=$room_type?></td> 
            <?php if ($room_status ==1) {  
 $sh = "bgcolor=\"red\"";  
 } else {  
 $sh = "bgcolor=\"green\"";  
 }  
 ?> 
            <td  style="white-space: nowrap;" align="center" <?=$sh?> ></td> 
            <?php 
$ic++; 
if ($ic > $column) { 
?> 
          </tr> 
          <?php 
 $ic =1; 
 }  
} 
?>
?>
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 18:34:36 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เดียวก่อนนะครับผม งง 
 ตกลง น้องใช้ Database ของอะไรครับ
 
 Mysql or oracle
 
 ผมจะได้เขียนให้ถูกต้องครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 21:49:25 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | พี่ค่ะยังอยู่ไหม ปอนด์ใช่oracel 10gค่ะ   เป็นociนะค่ะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 23:19:37 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ของปอนด์นะทำเกี่ยวกับเว็บไม่เกี่ยวกะ pda นะค่ะ ที่เคยถามเรื่องpdaไปนะ ถามให้เพื่อน แต่ถ้าพี่เขียนให้ได้ก็ดีค่ะ ขอบคุณค่ะ ของเพื่อนเค้าใช้ oracel 10g  เป็นodbcนะค่ะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 23:22:18 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เอ้าเป็นว่าติดปัญหา แล้วมา post คับเดียวผม ตอบให้ ครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-24 23:53:42 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | พี่ค่ะ ยังอยู่ช่ายม่ะ พี่ช่วยดูโค้ดให้หน่อยสิค่ะ  อืม ที่เคยโพสไว้ล่าสุด นะค่ะ ช่วยเค้าไปดูให้หน่อยนะค่ะ ก็แก้แล้วแต่มันไม่ได้อ่ะค่ะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 00:20:37 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | หวัดดีคับ ยินดีที่ได้รู้จัก เห็นบอกว่ามีปัญหาให้โพสไว้ งั้นผมขออนุญาตินะคับ ช่วยผมหน่อยนะ 
 คือว่าผมใช้ปฏิทินให้เลือก ว/ด/ป แล้วกด submit ให้ไปเช็คค่ากับตัวแปรที่ผมประกาศไว้ว่าอีกฟอร์มหนึ่ง ถ้าเลือกเกิน2เดือนให้ Alart แล้วให้กลับไปกรอกข้อมูลใหม่ ไม่รู้ว่าค่าที่ส่งไปกับตัวแปรที่ประกาศไว้ถูกต้องหรือไม่ช่วยผมดูหน่อยนะคับ มันขึ้นเกิน2เดือนตลอดเลย ผมต้องแก้ตรงไน๋ อย่างไรคับ
 
 <?
 
 $strDate=date("j-n-Y ", mktime(date("H")+0, date("i")+0, date("s")+0, date("n")+2 , date("j")+0, date("Y")+0));
 $date;
 
 if ($date < $strDate) {
 echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>";
 }
 ?>
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 09:35:41 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | นี้ครับ 
 from น้องรับค่าอะไร มา
 
 แบบไหนครับ
 
 น้องตัดคำส่วนที่รับค่ามาเอาเฉพาะ month อ่ะครับ แล้วก็เอามาเปรียบเทียบ กัน date("m") อ่ะครับ
 
 มากกว่าก็ให้ กลับไปทำงานที่หน้าเดิม
 
 แบบนี้อ่ะครับ
 
 ถ้า code รอสักพักเดียวผมเขียนให้ ตอนนี้ติดประชุมก่อนครับ
 
 ขอบคุณนะเดียวผม มาช่วยแก้ให้
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 10:39:20 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | พี่ dr.website ใจดีที่สุดเลยนะค่ะ อิอิ ปอนด์ขอชมและนับถือ ที่สำคัญเก่งและมีน้ำใจมากๆๆๆๆ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 17:08:38 | By :
                            มึนจัง |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เก่งดีครับ ฝากเนื้อฝากตัวด้วยนะคับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 17:15:11 | By :
                            pokultra |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ไม่เก่งหรอกนะครับ 
 พี่ๆ ใน thaicreate เก่งหลาย คน
 
 ผมแค่เอาประสบการณ์ที่ผมทำงานจิงๆ มาแบ่งปัน ครับ
 
 ช่วยกันไปครับผม
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-25 18:30:25 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ขอคุณนะคับสำหรับความมีน้ำใจ  ผมแก้แล้วงง แก้ไม่ได้คับผมรอความช่วยเหลือจากพี่นะคับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 10:27:17 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | งั้น ส่ง Code เต็มๆ มาให้ดูหน่อยครับ 
 อธิบายให้ระเอียดเลยนะครับเดียวผมช่วยแก้ ครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 10:33:21 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | หน้าแรกก้อเป็นฟอร์มกรอกข้อมูลทั่วไปผมใช้โค้ดปฏิทินที่เป็น javascript  Include เข้ามาคับ เป็นแบบให้เลือก ลง textbox (<?=date('j-n-Y') ?>) ประมาณนี้ กดsubmit ส่งค่าไปหน้าที่สอง
 
 หน้าสอง ทำการเช็คค่าที่รับมาจากหน้าแรก (ตรงอื่นผมได้หมดแล้ว ที่นี้ต้องการเช็คแค่ ค่าที่รับมาจากปฏิทินว่าห้ามเกิน2เดือนจากที่เลือก)
 <?
 
 $strDate=date("j-n-Y ", mktime(date("H")+0, date("i")+0, date("s")+0, date("n")+2 , date("j")+0, date("Y")+0));
 /*
 date("H")+0 // ชม.
 date("i")+0 // นาที
 date("s")+0 // วินาที;;;;
 date("d")+0 // วัน
 date("m")+0 // เดือน
 date("Y")+0 // ปี
 */
 
 if ($date > $strDate) {
 echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>";
 }
 ?>
 
 ผมต้องขอบคุณอีกครั้งนะพี่ ในน้ำใจครั้งนี้
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 11:36:27 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | เดียวก่อนนะครับเราเอาเฉพาะวันเดือนปีหรือเปล่าครับ 
 ค่าที่ส่งมา from 1 เป็นวันที่ แบบไหน แบบนี้หรือเปล่า 2009/05/03 หรือเปล่า
 
 แล้ว ค่าที่เอามาเปรียบเทียบ จะให้ใช้เวลาเข้ามาด้วยหรือเปล่า
 
 หรือแค่วันครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 11:54:59 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ช่ายคับรูปแบบวันที่ถูกต้องแล้วคับ แบบนั้นแหระคับ 
 ค่าที่เอามาเปรียบเทียบเวลาไม่ต้องคับ แค่วันอย่างเดียวคับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 13:11:15 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | หล่อแถมใจดีอีกต่างหาก...  
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 13:12:55 | By :
                            paphun |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | Code (PHP) 
 <?
$strDate = "2009/06/15"; // <--- ค่าที่ได้รับมาจาก from นะครับ
///////////////////////////////////////////////////////
$Month_now = date("n");
$Month_str = date("n",strtotime($strDate));
$Month_total = $Month_str - $Month_now;
if($Month_total > 2){
	echo "มากกว่า 2 เดือน";
}else{
	echo "น้อยกว่า 2 เดือน";
}
?>
 มาตอบให้แล้วครับ
 
 ไม่รู้ว่าใช้ที่ต้องการหรือเปล่าลองดูนะครับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 14:36:41 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ขอบคุณมากเลยคับพี่ แต่ว่าก็ยังไม่ได้คับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 15:40:14 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ไอที่ยังไม่ได้อ่ะ ตรงไหนหรอ 
 งง บอกให้หน่อย ติดตรงไหนที่ไม่ได้ครับผม...
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 17:29:11 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | มันขึ้นเกิน2เดือนตลดอเลยคับ แล้วมันก้อไม่รับค่าจากที่เราเลือกปฏิทินนะ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 17:49:38 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ส่ง code ให้ดูหนอ่ยได้ไหมครับ ทั้งหน้า from และหน้า php ครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-26 18:23:01 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมต้องขอบคุณอีกครั้ง ที่ช่วยผมนะพี่เก่งแล้วใจดีด้วย <form method="POST" action="success.php" id="form1" name="form1" onsubmit="return checkform();">
 <table border=0 width=460 cellspacing=0 cellpadding=0>
 <tr>
 <tr>
 <td bgcolor=Black></td>
 <td align=center>
 <table border=0 width=460 cellspacing=0 cellpadding=0>
 <tr bgcolor=AliceBlue  height=25>
 <td colspan=2 align=left valign=center bgcolor="#006699"> <font face="MS Sans Serif, Thonburi" size=1 color=GRAY><b> <span class="style7">1. เลือก <strong>รถยนต์ที่ต้องการTestDrive<?php require('c14.php'); ?>
 
 
 </strong></span></b></font></td>
 </tr>
 <tr>
 <td colspan=10 background=/i/blue_dot.gif><img src=/i/p.gif height=3></td>
 </tr>
 <tr>
 <td align=center bgcolor="#E6F4F6">
 <table width=100% border=0 align="left" cellpadding=1 cellspacing=0>
 <tr bgcolor="#e6f4f6">
 <td width=120 align=left valign=center bgcolor="#e6f4f6"> <span class="style9"> <img src="images/star.gif" width="11" height="10"> Username </span></td>
 <td colspan="2" align=left valign=top>
 <div style="float:left;">
 <input id="txtUsername" class="INPUT_CNTL_BGCOLOR" type=TEXT size=15 name="Username" maxlength=50 onFocus="showsuggest('username');" onBlur="hidesuggest('username');">
 </div>
 <div style="position:relative;float:left;">
 <div id="sugg_username" align=left style="display:none;position:absolute;z-index:1000px;background-color:white;width:257px;top:4px;">
 <div style="float:left;margin-top:1px;"> <img src="images/kohsamet-arrow.gif" width=10 height=10> </div>
 <div style="float:right;"> <font face="MS Sans Serif, Thonburi" size=1 color=Black> (ตัวอักษรภาษาอังกฤษ-ไทย หรือ ตัวเลข ตั้งแต่ 6 หลักขึ้นไป โดยไม่มีการเว้นวรรค และห้ามใช้เครื่องหมายใด ๆ ยกเว้นเครื่องหมาย _ เท่านั้น) </font> </div>
 </div>
 </div></td>
 </tr>
 <tr bgcolor="#e6f4f6">
 <td align=left valign=center bgcolor="#e6f4f6"> <span class="style9"> <img src="images/star.gif" width="11" height="10"> Password </span></td>
 <td colspan="2" align=left valign=top>
 <div style="float:left;">
 <input id="txtPassword" class="INPUT_CNTL_BGCOLOR" type="password" size=15 name="Password" maxlength=10 onFocus="showsuggest('password');" onBlur="hidesuggest('password');">
 </div>
 <div style="position:relative;float:left;">
 <div id="sugg_password" align=left style="display:none;position:absolute;z-index:1000px;background-color:white;width:257px;top:4px;">
 <div style="float:left;margin-top:1px;"> <img src="images/kohsamet-arrow.gif" width=10 height=10> </div>
 <div style="float:right;"> <font face="MS Sans Serif, Thonburi" size=1 color=Black> (ตัวอักษรภาษาอังกฤษ-ไทย หรือ ตัวเลข ไม่เกิน 10 ตัวอักษร โดยไม่มีการเว้นวรรค และห้ามใช้เครื่องหมายใด ๆ ยกเว้นเครื่องหมาย _ เท่านั้น) </font> </div>
 </div>
 </div></td>
 </tr>
 <tr bgcolor="#e6f4f6">
 <td align=left valign=center bgcolor="#e6f4f6"> <span class="style9"> <img src="images/star.gif" width="11" height="10"> Confirm Password </span></td>
 <td colspan="2" align=left valign=top>
 <div style="float:left;">
 <input id="txtConfirm" class="INPUT_CNTL_BGCOLOR" type="password" size=15 name="Confirm" maxlength=10 onFocus="showsuggest('conpassword');" onBlur="hidesuggest('conpassword');">
 </div>
 <div style="position:relative;float:left;">
 <div id="sugg_conpassword" align=left style="display:none;position:absolute;z-index:1000px;background-color:white;width:257px;top:4px;">
 <div style="float:left;margin-top:1px;"> <img src="images/kohsamet-arrow.gif" width=10 height=10> </div>
 <div style="float:left;"> <font face="MS Sans Serif, Thonburi" size=1 color=Black>(ใส่ password อีกครั้งเพื่อยืนยันความถูกต้อง) </font> </div>
 </div>
 </div></td>
 </tr>
 <tr bgcolor="#e6f4f6">
 <td align=left valign=center bgcolor="#e6f4f6"><span class="style9"> <span class="style11">---</span>รหัสจองรถยนต์ลูกค้า</span></td>
 <td width="50" align=left valign=top bgcolor="#CCCCCC"><span class="style8">
 <?
 // include("connect.php");
 $host="localhost";
 $user="root";
 $password="";
 $dbname="testdrive";
 mysql_connect($host,$user,$password)or die ("ติดต่อฐานข้อมูลไม่ได้");
 mysql_select_db($dbname) or die ("ติตต่อฐานข้อมูลไม่ได้");
 $sql="select * from employee ";
 $sqlquery = mysql_db_query( $dbname,$sql );
 //$sqlquery=$sqlquery+3;
 //echo"TM-00".($sqlquery);
 print"TM-00".mysql_num_rows($sqlquery);
 mysql_close();
 //$sql3= "select * from employee";
 //$res3= mysql_db_query($sql3,$conn);
 //while($row = mysql_fetch_array($res3))
 //$sqlquery = mysql_db_query( $dbname,$sql );
 //{
 //$familyname[]=$row[familyname];
 //$id[] =  $row[id];
 //}
 //$row3 = mysql_num_rows($sql3);
 // $row4=$row3+1;
 // $code = "$row4";
 // echo "TM - 00$row4";
 ?>
 </span></td>
 <td width="304" align=left valign=top> </td>
 </tr>
 <tr bgcolor="#e6f4f6">
 <td align=left valign=center bgcolor="#e6f4f6"> <span class="style9"><img src="images/star.gif" width="11" height="10"> รุ่นรถยนต์</span></td>
 <td colspan="2" align=left valign=top><select name="select7"onChange="SelectSubCat();">
 <option value="" selected>เลือกรถยนต์</option>
 
 </select>                         <select  id="select6"name="select6">
 <option value="">เลือกสาขา</option>
 </select>
 
 <span class="style8"><span class="style9"><img src="images/star.gif" width="11" height="10"> </span>พื้นที่ต้องการทดลอง</span></td>
 </tr>
 </table></td>
 </tr>
 <tr>
 <td colspan=10 background=/i/blue_dot.gif><img src=/i/p.gif height=3></td>
 </tr>
 <tr bgcolor=AliceBlue  height=25>
 <td colspan=2 align=left valign=center bgcolor="#5899F1"><span class="style7"> <font face="MS Sans Serif, Thonburi" size=1 color=GRAY><b> <strong>2. กรอกข้อมูลสำหรับการติดต่อ</strong></b> </font></span></td>
 </tr>
 <tr>
 <td colspan=10 background=/i/blue_dot.gif><img src=/i/p.gif height=3></td>
 </tr>
 <tr>
 <td align=center bgcolor="#E6F4F6">
 <table border=0 width=480 cellspacing=0 cellpadding=1>
 <tr bgcolor="#E6F4F6">
 <td width=120 align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style11">---</span>E-mail </span></td>
 <td width=360 align=left valign=top>
 <div style="float:left;">
 <input id="txtEmail" class="INPUT_CNTL_BGCOLOR" type=TEXT size=15 name="Email" maxlength=70 value="" onFocus="showsuggest('email');" onBlur="hidesuggest('email');">
 </div>
 <div style="position:relative;float:left;">
 <div id="sugg_email" align=left style="display:none;position:absolute;z-index:1000px;background-color:white;width:257px;top:4px;">
 <div style="float:left;margin-top:1px;"> <img src="images/kohsamet-arrow.gif" width=10 height=10> </div>
 <div style="float:right;"> <font face="MS Sans Serif, Thonburi" size=1 color=Black> กรุณากรอกให้ถูกต้องเพื่อประโยชน์ของท่าน ลักษณะ e-mail ที่ถูกต้องจะไม่มี www นำหน้า และไม่มีการเว้นวรรค เช่น [email protected] เป็นต้น </font> </div>
 </div>
 </div></td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style9"><img src="images/star.gif" width="11" height="10"> </span>ชื่อ - นามสกุล </span></td>
 <td align=left valign=top>
 <input class="INPUT_CNTL_BGCOLOR" type=TEXT size=30 name="textfield" maxlength=50 value="">                        </td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style9"><img src="images/star.gif" width="11" height="10"> </span>โทรศัทพ์มือถือ</span></td>
 <td align=left valign=top>
 <input id="textfield2" class="INPUT_CNTL_BGCOLOR" type=TEXT size=10 name="textfield2" maxlength=10 onKeyUp="isIntDigit(this);" onKeyDown="isIntDigit(this);" onFocus="messageHandler(event)" >                        </td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style9"><img src="images/star.gif" width="11" height="10"> </span>วันที่ต้องการขับ</span></td>
 <td align=left valign=top>
 
 </select>
 
 
 
 
 <?php include("c13.php"); ?>
 
 
 <span class="style12">กรุณานัดล่วงหน้าก่อน 1 วัน แต่ไม่เกิน 2 เดือน </span></td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style9"><img src="images/star.gif" width="11" height="10"></span> เวลา</span></td>
 <td align=left valign=top>
 <select name="select4">
 <option value="">กำหนดเวลา</option>
 <option value="09.00 - 10.00">09.00 - 10.00น.</option>
 <option value="10.00 - 11.00">10.00 - 11.00น.</option>
 <option value="11.00 - 12.00">11.00 - 12.00น.</option>
 <option value="12.00 - 13.00">12.00 - 13.00น.</option>
 <option value="13.00 - 14.00">13.00 - 14.00น.</option>
 <option value="14.00 - 15.00">14.00 - 15.00น.</option>
 <option value="15.00 - 16.00">15.00 - 16.00น.</option>
 <option value="16.00 - 17.00">16.00 - 17.00น.</option>
 </select> </td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8"> <span class="style9"><img src="images/star.gif" width="11" height="10"> </span>จังหวัด</span></td>
 <td align=left valign=top><select name="select5">
 <option>กรุงเทพฯและปริมณฑล</option>
 </select></td>
 </tr>
 <tr bgcolor="#E6F4F6">
 <td align=left valign=center bgcolor="#E6F4F6"> <span class="style8">
 </span></td>
 <td align=left valign=top>
 <?
 //require_once('Connections/testdrive.php');
 $host="localhost";
 $user="root";
 $password="";
 $dbname="testdrive";
 mysql_connect($host,$user,$password)or die ("ติดต่อฐานข้อมูลไม่ได้");
 mysql_select_db($dbname) or die ("ติตต่อฐานข้อมูลไม่ได้");
 $sql="select * from employee ";
 //$sql="select * from employee  where generation='select7' and branch='select6' and date='date' and month='select2'
 //and year='select3' and time='select4' ";
 $sqlquery = mysql_db_query( $dbname,$sql );
 //$number = mysql_num_rows( $g );
 print"จำนวนลูกค้าที่จองรถทดลองขับทั้งหมด".mysql_num_rows($sqlquery)."คน";
 mysql_close();
 //if ($number >=1){
 //echo "รุ่นรถและเวลาดังกล่าวมีลูกค้าจองทดสอบแล้ว";
 //} else {
 //echo "จองได้คับ";
 //}
 //if ($SSID==""){$SSID=$uID;}
 //$sql1= "SELECT a1.*,a2.* FROM tblregisagent a1 inner join tbluser a2  on a1.userid = a2.userid  where  a1.userID ='$SSID' ";
 //$result = mysql_query( $sql1 );
 //$rs = mysql_fetch_array( $result );
 ?> 
 <?php // สร้างตัวแปรเพื่อรับค่าและส่งค่า
 // $gt = $_POST['generation'];
 // $gtx = show($gt);
 ?>                         </td>
 </tr>
 </table></td>
 </tr>
 </table></td>
 <td bgcolor=Black></td>
 
 </tr>
 <tr bgcolor=Gray height=30>
 <td bgcolor=black><img src=/i/p.gif height=1 width=1></td>
 <td align=center>
 <input type="hidden" name="MM_insert" value="form1"><br>
 <input name="submit" type="submit" class="BUTTON_BGCOLOR" value="ส่งข้อมูล รถทดลองขับ">
 </td>
 </tr>
 
 <tr>
 <td bgcolor=WHITE><img src=/i/p.gif height=2 width=1></td>
 <td colspan=3 bgcolor=LightGrey><img src=/i/p.gif height=2></td>
 </tr>
 </table>
 
 หน้ารับค่า
 <?
 $strDate = "2009/06/15"; // <--- ค่าที่ได้รับมาจาก from นะครับ
 ///////////////////////////////////////////////////////
 $Month_now = date("n");
 $Month_str = date("n",strtotime($strDate));
 $Month_total = $Month_str - $Month_now;
 if($Month_total > 2){
 echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>";
 }else{
 echo "น้อยกว่า 2 เดือน";
 }
 ?>
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-27 09:48:00 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมลอง run แล้วนะก็ผ่านนะมัน ขึ้นบอกว่า ระยะการจองต้องไม่เกิน 2 เดือน 
 Code (PHP)
 
 <?
$strDate = "2009/06/15"; // <--- ค่าที่ได้รับมาจาก from นะครับ 
/////////////////////////////////////////////////////// 
$Month_now = date("n"); 
$Month_str = date("n",strtotime($strDate)); 
$Month_total = $Month_str - $Month_now; 
if($Month_total > 2){ 
echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>";
}else{ 
echo "น้อยกว่า 2 เดือน"; 
} 
?>
 ลองตรวจสอบดูคับว่า ค่า from ที่รับมาเป็นค่า 2009/06/15 ตัวนี้หรือเปล่า
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-27 11:12:22 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | คืออย่างนี้คับ ไม่ว่ามันจะเลือกน้องหรือมากกว่า2เดือนมันก้อขึ้นอะคับ ต้องการแบบเลือกน้องกว่าก้อบันทึก มากกว่าก้อค่อยเตือนคับ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-27 11:30:11 | By :
                            thank |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | Code (PHP) 
 <? 
$strDate = "2009/07/15"; // <--- ค่าที่ได้รับมาจาก from นะครับ  
///////////////////////////////////////////////////////  
$Month_now = date("n");  
$Month_str = date("n",strtotime($strDate));  
$Month_total = $Month_str - $Month_now;  
if($Month_total > 2){  
//echo "มากกว่า 2 เดือน"; 
echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>"; 
}else{  
echo "น้อยกว่า 2 เดือน";  
}  
?> 
 อันนี้จะขึ้นเตือนนะครับของผม
 
 Code (PHP)
 
 <? 
$strDate = "2009/05/15"; // <--- ค่าที่ได้รับมาจาก from นะครับ  
///////////////////////////////////////////////////////  
$Month_now = date("n");  
$Month_str = date("n",strtotime($strDate));  
$Month_total = $Month_str - $Month_now;  
if($Month_total > 2){  
//echo "มากกว่า 2 เดือน"; 
echo "<script>alert('ระยะเวลาการจองต้องไม่เกิน 2 เดือน');window.location.href='submit.php';history.go (-1);</script>"; 
}else{  
echo "น้อยกว่า 2 เดือน";  
}  
?> 
อันนี้ไม่เตือนครับ
 
 ลองตรวจสอบวันที่ให้ดีๆ นะครับ ในเครือ่งคุณและก็ใน Code ตัว $strDate ว่าถูกต้องไม
 
 กรุณา เปิด หน้าใหม่แล้วก็ refresh ด้วยนะคับ
 
 ลองดูสู่ๆ
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-03-27 11:42:02 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ได้ไอเดียดีๆๆไปใช้เพียบ..ขอบคุณจริงๆๆกับทุกความเห็น  
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-08-11 15:13:57 | By :
                            TOTO |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ว่าแต่ เจ้าของกระทู้ พักหลังเงียบไปเลยนะครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-08-11 15:42:17 | By :
                            panyapol |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ตรงติดเรา ไม่เช็คค่าว่างใน textbox มั่งเหรอครับ ผมไม่ได้กรอกอะไรเลยพอ submit ก็ดันขึ้นข้อความนี้มาได้ "ทางเราได้รับข้อมูลของท่านเรียบร้อยแล้ว
 ขอบคุณครับ"
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2009-08-20 12:53:05 | By :
                            winwinwin |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | มาแล้วคับพี่น้อง.. 
 พอดี ติดงานเยอะไปหนอ่ย.
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-04-22 18:36:27 | By :
                            dr.website |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              |  เล่นข้ามปีเลยแหะ 55555 คงรวยแล้วละซิ งานเยอะอ่ะ หุหุหุหุ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-04-22 18:55:36 | By :
                            somparn |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | แจ่มมากมายครับ 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            2010-04-22 22:12:07 | By :
                            icute |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |