ตรวจสอบระดับความปลอดภัยของ รหัสผ่านด้วย Ajax

25 September 2008

ตัวอย่าง คลิกที่นี้

ดาวโหลด คลิกที่นี้

ไฟล์ pass_ajax.php

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >
 <html >
 <head >
 <title >Ajax Password ตรวจสอบระดับความปลอดภัยของ รหัสผ่านด้วย Ajax </title >
 <meta http-equiv="Content-Type" content="text/html; charset=windows-874" >

 <style type="text/css" >
body {
	background: #333;
	color: #f8f8f8;
	font: 12px 'lucida sans unicode', lucida, helvetica, verdana, arial, sans-serif;
	text-align: center;
}
a:link, a:visited  { 
	color: #f8f8f8;
	text-decoration: underline;
}
#content{
border-top:dotted 2px #c0f813;
border-bottom:dotted 2px #c0f813;
}
#footer{
padding: 0px 0px 0px 0px;
margin: 125px 0px;
font-size: 9px;
}
 </style >
 <script type="text/javascript" language="Javascript" >
 var http_request = false;
   function makeRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      http_request.onreadystatechange = alertContents;
      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {

            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   
   function get(obj) {
      var getstr = "?";
      for (i=0; i <obj.childNodes.length; i++) {
         if (obj.childNodes[i].tagName == "INPUT") {
            if (obj.childNodes[i].type == "text") {
               getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
            }

         }   
       
      }
      makeRequest('get.php', getstr);
   }

 </script >
 </head >

 <body >

	 <form action="javascript:get(document.getElementById('passform'));" name="passcheck" id="passcheck" >

	พิมพ์รหัสผ่าน แล้วจะมีระดับความปลอดภัยของรหัสผ่านแสดงขึ้น
	 <p > 
		     <input name="password" type="text" onKeyUp="javascript:get(this.parentNode);" >
       </p >
 </form >
		 <br/ >
    <span id="myspan" > </span > 
    <br/ > <br/ >
 
    <br/ >
 </body >
 </html >







บทความในหมวดที่่น่าสนใจ อื่นๆ AJAX Learning

28 Oct 08 ฟังก์ชัน สร้าง ajax object ไว้ใช้งานอย่างง่าย อ่าน 3892 29 Sep 10 แนวทาง การสร้าง ระบบตรวจสอบ การล็อกอิน อย่างง่าย ด้วย ajax ใน jQuery และ php อ่าน 3862 04 Jan 10 ดึงไฟล์ xml (rss) ไฟล์แบบ cross domain มาแสดงด้วย ajax ใน jQuery อย่างง่าย อ่าน 3642 10 May 10 แก้ปัญหา ปุ่ม back ปุ่ม forward กับการใช้งาน ajax โหลดหน้าเพจ ด้วย jQuery plugin อย่างง่าย อ่าน 3254 25 Sep 08 ตรวจสอบโดเมน Domain ด้วย Ajax อ่าน 3194 04 May 10 ประยุกต์ ใช้งาน php และ ajax ใน jQuery แสดงผลลัพธ์ คล้าย twitter อ่าน 3194 27 Dec 10 การสร้าง ajax dictionary จาก longdo ด้วย jQuery อ่าน 2698

บทความคนเข้าอ่านวันนี้

25 Sep 08 ตรวจสอบระดับความปลอดภัยของ รหัสผ่านด้วย Ajax อ่าน 3928 25 Sep 08 ฟังก์ชั่นเกี่ยวกับ วันที่ เวลา ใน javascript อ่าน 7135
จำนวนผู้เยี่ยมชม 784684
คน 2012 © Copyright ninenik.com. All rights reserved.