Đăng Nhập

Vui lòng khai báo chính xác tên truy cập và mật khẩu!

Quên mật khẩu?

    Code tìm mã MD5 trong php

      Admin
      Admin

      Giới tính : Nam

      Đến từ : TPHCM

      Ngày Tham gia : 03/04/2011

      Tổng số bài gửi : 2292

      #1

       Mon Sep 12, 2011 10:12 am

      Code tìm mã MD5 trong php

      Mình tìm được cái này. Thấy hữu ích share cho ae.
      Index.php
      Code:
      <html>
      <head>
      <meta  http-equiv="content-type" content="text/html; charset=utf-8;"/>
      <script language="javascript">

      function getAJAX(){
          var xmlhttp;
        if (window.ActiveXObject) {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
        else if (window.XMLHttpRequest){xmlhttp = new XMLHttpRequest();}
        return xmlhttp;
      }
      function xuli(){
          var =text=document.getElementById("text");
          store=document.getElementById("divNAV").innerHTML;
          http=new getAJAX();
          http.open("POST","xuli.php",true);
          http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
          http.onreadystatechange=function(){
              if (http.readyState==4){
                  document.getElementById("divNAV").innerHTML=http.responseText;
          }}
          http.send("text="+text.value);
          }
      function trolai(){
          document.getElementById("divNAV").innerHTML=store;
      }
      </script>
      <body>
      <center><h2>Chương trình tìm mã MD5 đơn giản</h2></center>
      <div id="divNAV" align="center">
      <b>Nhập vào chuỗi cần chuyển sang MD5:</b> 
      <input type="text" id="text"/>
      <input type="button" onclick="xuli()" value="Xử lí"/>
      </div>
      </body></head></html>








      function getAJAX(){
      var xmlhttp;
      if (window.ActiveXObject) {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
      else if (window.XMLHttpRequest){xmlhttp = new XMLHttpRequest();}
      return xmlhttp;
      }
      function xuli(){
      var =text=document.getElementById("text");
      store=document.getElementById("divNAV").innerHTML;
      http=new getAJAX();
      http.open("POST","xuli.php",true);
      http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
      http.onreadystatechange=function(){
      if (http.readyState==4){
      document.getElementById("divNAV").innerHTML=http.responseText;
      }}
      http.send("text="+text.value);
      }
      function trolai(){
      document.getElementById("divNAV").innerHTML=store;
      }


      Chương trình tìm mã MD5 đơn giản



      Nhập vào chuỗi cần chuyển sang MD5: 



      xuli.php

      Code:

      <?php
      echo("<b>Mã MD5 của chuỗi vừa nhập là:</b> ".md5($_POST["text"]));
      ?>
      <meta  http-equiv="content-type" content="text/html; charset=utf-8;"/>
      <input type="button" onclick="trolai()" value="Trở lại"/>