شكرا لك اخي العزيز
عم بحاول اجعل ال AJAX ولاكن للاسف لا تعمل!!!!!
هذا الكود الحالي من ملفي- اذا بتسمح تشوفهم وتشوف ايش المشكلة
عندما اضغط زر login يتغير الرابط الي التالي index.php?action=login
ولاكن لا يتم عرض اي نتائج!
هذا كود ملف ال index.php
	كود:
	
<?php
require_once("../includes/config.php");
require_once("../functions/functions.php");
include("../includes/meta-general.php");
?>
<script src="login.js"></script>
<style type="text/css">
  html {
  font: 85% arial, helvetica, sans-serif;
  background: #fff;
  color: #777777;
  line-height: 1;
  direction: ltr;
  }
input {
  display: inline-block;
  height: 29px;
  margin: 3px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #d9d9d9;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  color: #363636;
   
  }
  
  
input:focus {
  display: inline-block;
  height: 29px;
  margin: 3px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #d24836;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  
     -moz-box-shadow:    inset 0 0 7px #e1e1e1;
   -webkit-box-shadow: inset 0 0 7px #e1e1e1;
   box-shadow:         inset 0 0 7px #e1e1e1;
  }
  
  
  .signin-box {
	  
  display: inline-block;
  width: 300px;
  margin: 0 auto; 
 
  padding: 15px;
  
  background: #fff;
  border: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  
  -moz-box-shadow:    inset 0 0 7px #e1e1e1;
   -webkit-box-shadow: inset 0 0 7px #e1e1e1;
   box-shadow:         inset 0 0 7px #e1e1e1;	  
	  
  }
  
</style>
<?php
DisplayMeta("$CompanyName - Restricted Access","$CompanyName - Restricted Access","$CompanyName - Site Administration Login");
$action = $_POST['action'];
if($action == "login"){
echo "test";
/// if member is not found >>>>>> Send A JSON 
if( $_POST['email'] == "test" && $_POST['password'] == "test"){
	
	echo "Good work";
	
} else {
	
$json = '{"loginchecks": {';    
        $json .= '"logincheck":[ ';    
            $json .= '{"notfound":  "'; if(!$found){ $json .= 1; }  $json .='"}';
        $json .= ']';
        
$json .= '}}';        
echo $json;     
}
} else {
echo '
<div class="signin-box">
  <label for="admin"><strong>Administrator Login</strong></label><br /><br />
  <form  name="reg-form" id="reg-form" onSubmit="return LoginblockSubmit();" method="post">
<div class="email-div">
  <label for="Email"><strong class="email-label">Username</strong></label>
  <input spellcheck="false" name="email" id="Email" value="" type="text">
</div>
<div class="passwd-div">
  <label for="Passwd"><strong class="passwd-label">Password</strong></label>
  <input name="password" id="Passwd" type="password">
</div>
  <input class="g-button g-button-submit" name="signIn" id="signIn" value="Sign in" type="submit">
<div id="login_no_errors" class="errors" align="right"></div>
<div id="login_password_errors" class="errors" align="right"></div>
<div id="login_errors" class="errors" align="right"></div>
  </form>
  
  
</div>
  ';
}
echo "</body>
</html>";
?>
 
وهذا ملف ال login.js
	كود:
	            var sendReq = getXmlHttpRequestObject();
            var receiveReq = getXmlHttpRequestObject();
            var email ;
            var password;
            var login_errors=0;
            
/////////////////////////////////////////////////////////////////////////////////////////
          //Gets the browser specific XmlHttpRequest Object
            function getXmlHttpRequestObject() {                
                if (window.XMLHttpRequest) {
                    return new XMLHttpRequest();
                } else if(window.ActiveXObject) {
                    return new ActiveXObject("Microsoft.XMLHTTP");
                } else {
                    document.getElementById('login_no_errors').innerHTML = 'المتصفح الخاص بك يحتاج إلى تحديث !';
                }
            }
///////////////////////////////////////////////////////////////////////////////////////// Mail & Password check via Ajax
      function checklogin() {                                
                            
                if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
                    receiveReq.open("POST", 'admin/index.php?action=login', false);                                    
                    receiveReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');                    
                    receiveReq.onreadystatechange = handleReceiveLoginCheck;                                         
                    var param = 'email=' + email+'&password='+password;                                                                
                    receiveReq.send(param);                                        
                }            
            }
                        
            function handleReceiveLoginCheck() {                                
                if (receiveReq.readyState == 4) {                    
                    
                    var response = eval("(" + receiveReq.responseText + ")");                               
                    
                    var notfound = response.loginchecks.logincheck[0].notfound;                    
                                       
                    if(notfound == 1) { 
                                               
                        login_errors=1;                                                
                        
                        // to remove please wait
                        document.getElementById('login_no_errors').innerHTML = '';
                        
                        document.getElementById('login_errors').innerHTML = "<li>يوجد خطأ فى كلمة المرور أو إسم المستخدم</li>";                                              
                    }
                    
                }
                                
            }  
            
//////////////////////////////////////////////////// Block the Submit Button , validate ,Reset all values  to Revalidate
            
            function LoginblockSubmit() {               
// RESET
login_errors = 0;
document.getElementById('login_errors').innerHTML ="";                           
document.getElementById('login_email_errors').innerHTML ="";                           
document.getElementById('login_password_errors').innerHTML ="";                           
document.getElementById('login_no_errors').innerHTML = '<img src="http://www.swalif.net/softs/images/misc/loading_1.gif" border="0" /> إنتظر من فضلك .. ';
                                
                LoginValidate();
                return false;
            }
///////////////////////////////////////////////////////////////////////////////////////// Entries Validation
            
            function LoginValidate(){                
                
               email = document.getElementById('email').value; 
               password = document.getElementById('password').value; 
           
           
//---------------------------------------------------------------------------------------//
               
               if(!email){                                  
// to remove please wait
document.getElementById('login_no_errors').innerHTML = '';                   
document.getElementById('login_email_errors').innerHTML = "<li>من فضلك أدخل بريدك الإلكترونى</li>";     login_errors=1;           
               }else if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
// to remove please wait
document.getElementById('login_no_errors').innerHTML = '';
document.getElementById('login_email_errors').innerHTML = "<li>صيغة البريد الإلكترونى غير صحيحة</li>";  login_errors=1;     
               }
//---------------------------------------------------------------------------------------//                              
               if(!password){
// to remove please wait
document.getElementById('login_no_errors').innerHTML = '';                                      
document.getElementById('login_password_errors').innerHTML = "<li>من فضلك أدخل كلمة المرور</li>"; login_errors=1;
               }
 
 
//---------------------------------------------------------------------------------------//                               
    if(login_errors == 0){
                   
                   
                   checklogin();
                   
                   if(login_errors == 0){                       
                                      
                 document.getElementById('login_no_errors').innerHTML = '<img src="http://www.swalif.net/softs/images/misc/true.png" border="0" /> تم تسجيل الدخول بنجاح<br /> <img src="http://www.swalif.net/softs/images/misc/loading_1.gif" border="0" /> جارى إعادة التحويل .. '; 
                 setTimeout("location.href='index.php'", 2000);                                                                    
                                              
                   }
                                                         
               }
               
                
            }
//---------------------------------------------------------------------------------------//
 
شكرا جزيلا عزيزي