<!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>test</title> <script> var barcode = []; </script> </head> <body> <script> do{ str = prompt("Enter barcode : ",""); if(str==null){ break; } barcode.push(str); document.write(str +" " + barcode.length + "<br>"); }while(str!=null); </script> </body> </html>
<!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>test</title> </head> <body> <form action="test.php" id="barcodeForm" method="post"> </form> <?php if (empty($_POST)) { ?> <script> var form = document.getElementById("barcodeForm"); var str; while ((str = prompt("Enter barcode : ",""))) { var input = document.createElement("INPUT"); input.type = "hidden"; input.name = "barcodes[]"; // กำหนดชื่อแบบนี้เพื่อให้ php แปลงเป็น array input.value = str; form.appendChild(input); document.write(str + " " + form.elements.length + "<br />"); } form.submit(); </script> <?php } else { ?> <pre> <?php print_r($_POST); ?> </pre> <?php } ?> </body> </html>
function ajaxPost(array,url){ var string='{'; for(var i in array){ var value = array[i]; string += '"'+i+'":'+value+','; } string = string.slice(0, -1); string+='}'; $.post(url,eval("(" + string+")"),function(o){ //callback }); return false; }
echo $_POST[0]; // tekst1 echo $_POST[1]; // tekst2 echo $_POST[2]; // tekst3
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง