<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> function checkUserName(){ var u = document.getElementById('userName').value; $.post("check.php", { userName: u}, checkUserNameCompleted); } function checkUserNameCompleted(data) { if((data) == 0) { document.getElementById("test").style.display = ""; }else{ document.getElementById("test").style.display = "none"; return false; } } </script> </head> <body> <form> ชื่อผู้ใช้: <input type="text" name="userName" id="userName" /><span id="test" style="display: none; color: red;"> × ไม่สามารถใช้ Username นี้</span><br/> <input type="button" id="btnCheckUserName" value="ตรวจสอบชื่อผู้ใช้" onclick="checkUserName();" /> </form> </body> </html>
<?php //include "../config/connect.php"; if($_POST){ $userName = $_POST['userName']; //$sql = "select * from personnel where number = '$userName'"; //$result = mysql_query($sql); //if(mysql_num_rows($result) >0){ if($userName == admin){ echo "0"; } else { echo "1"; } } ?>
<script type="text/javascript"> $(document).ready(function(){ $("#btn1").click(function(){ $.post("jQuerypost.php", { data1: $("#txt1").val(), data2: $("#txt2").val()}, function(result){ $("#div1").html(result); } ); }); }); </script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง