السلام عليكم
احمي صفحتك بهذا الكود البسيط
طبعاً ضع له تسمية كما تشاء
//===============================
put the following line in the PHP page you want to protect:include ("./name.php"); 
//===============================
<?php
$selfSecure = 1;
$shellUser  = "demo";
$shellPswd  = "demo";
$adminEmail = "admin email here";
$fromEmail  = $HTTP_SERVER_VARS["SERVER_ADMIN"];
$Version = "Your details here (for example The Webmaster - webmaster@xxx.com)";
if($selfSecure){
    if (($PHP_AUTH_USER!=$shellUser)||($PHP_AUTH_PW!=$shellPswd)) {
       Header('WWW-Authenticate: Basic realm="MCE Web ADMIN only!"');
       Header('HTTP/1.0 401 Unauthorized');
       echo "<html>
         <head>
         <title>Error - Access Denied</title>
         </head>
         <h1>Access denied</h1>
         A warning message has been sent to the webmaster.  Your IP address has also been recorded
         <hr>
         <em>$Version</em>";
       if(isset($PHP_AUTH_USER)){
          $warnMsg ="
 Somebody tried to access the script on: http://".$HTTP_SERVER_VARS["HTTP_HOST"]."$PHP_SELF
 using the wrong username or password:
 
 Date: ".date("Y-m-d H:i:s")."
 IP: ".$HTTP_SERVER_VARS["REMOTE_ADDR"]."
 User Agent: ".$HTTP_SERVER_VARS["HTTP_USER_AGENT"]."
 username used: $PHP_AUTH_USER
 password used: $PHP_AUTH_PW
 
       ";
          mail($adminEmail,"Unauthorized Access",$warnMsg,
          "From: $fromEmail\nX-Mailer:$Version AutoWarn System");
       }
       exit;
    }
}
if(!$oCols)$oCols=$termCols;
if(!$oRows)$oRows=$termRows;
?>
				
			 
			
		 
			
				
			
				
			
			
				
__________________
ياراقد الليل مسرورا بأوله 
         إن الحوادث قد يطرقن أسحارا