<? include "connect.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=utf-8" /> <title>Untitled Document</title> </head> <body> <form method="post" action="index.php"> <input type="date" name="date" /> <input type="submit" name="submit" value="Save" /> </form> <? if($_POST['submit']!=NULL){ $date=$_POST['date']; $sql="INSERT INTO `TestWeb`.`test` (`test_id` ,`data_test`)VALUES (NULL , '$date');"; $result=mysql_query($sql) or die(mysql_error()); $sql_show="select * from test"; echo $sql_show; $result_show=mysql_db_query($db,$sql_show) or die(mysql_error()); $i=1; ?><table> <tr> <td>ที่</td> <td>วันที่</td> </tr> <? while($row_show=mysql_fetch_array($result_show)){?> <tr> <td><?=$i;?></td> <td><?=$row_show['data_test'];?></td> </tr> <? $i++; } }?> </table> </body> </html>
header("location:URL.php");
<?php include "connect.php"; if(isset($_POST['submit'])){ $date=$_POST['date']; $sql="INSERT INTO `TestWeb`.`test` (`test_id` ,`data_test`)VALUES (NULL , '$date');"; $result=mysql_query($sql) or die(mysql_error()); // คำสั่ง ของ admin ใส่ตรงนี้ครับ header("location: index.php"); } // ตรงนี้แค่แสดงผลอย่างเดียว $trs=''; $sql_show="select * from test"; echo $sql_show; $result_show=mysql_db_query($db,$sql_show) or die(mysql_error()); $i=1; while($row_show=mysql_fetch_array($result_show)){ $trs .= "<tr><td>$i</td><td>$row_show[data_test]</td></tr>"; $i++; } ?> <!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=utf-8" /> <title>Untitled Document</title> </head> <body> <form method="post" action="index.php"> <input type="date" name="date" /> <input type="submit" name="submit" value="Save" /> </form> <table> <tr><td>ที่</td><td>วันที่</td></tr> <?=$trs?> </table> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง