<!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" dir="ltr" lang="th" xml:lang="th"> <head> <meta http-equiv="content-type" content="text/html; charset=tis-620" /> <title>unlimit add</title> <script type="text/javascript"> //<![CDATA[ function addbox(){ var b=document.getElementById('inputboxes'); var el1=document.createElement("br"); var el2=document.createElement("input"); el2.name='f1[]'; el2.type='text'; el2.value=''; b.appendChild(el1); b.appendChild(el2); } //]]> </script> </head> <body> <?php if (isset($_POST['add'])){ //mysql_connect('localhost','root','password'); if (empty($_POST['f1'])){ $_POST['f1']=array(); } foreach($_POST['f1'] as $f1){ $query = "INSERT INTO tb1(f1) VALUES('$f1')"; echo "<br />$query"; //$res = mysql_query($query); //if (!$res){ // echo "\n<br />".mysql_error(); //} } }else{ echo 'nodata'; } ?> <form method="post" action="?" id="box"> <div id="inputboxes"> <?php foreach(array(1,2,3) as $n): ?> <br /><input type="text" name="f1[]" value="" /> <?php endforeach; ?> </div> <input type="submit" name="$addbox" value="เพิ่ม>>" onclick="addbox();return false;" /> <input type="submit" name="add" value="บันทึก" /> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง