الويب العربي

الويب العربي (http://www.arabwebtalk.com/index.php)
-   تبادل خبرات البرمجة (http://www.arabwebtalk.com/forumdisplay.php?f=57)
-   -   كود لاعطاع banned لشخص (http://www.arabwebtalk.com/showthread.php?t=32511)

NogomHost 08-08-2006 12:58 PM

كود لاعطاع banned لشخص
 
اولا ::

قوم بعمل ملف ونسمية مثلا ban.php
ثانيا نروح للهيدر ونضع اعلاه هذا الكود require('ban.php')

ثاليا :: نفتح الملف ban.php وتضع فيه الكود التالى

<?php
// For a single user ban
$ban_ip = 'xxx.xxx.xxx.xxx'; // ip address of the person you want to ban



// DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING
$visitor_ip = $_SERVER['REMOTE_ADDR']; // the ip address of the visitor
if($visitor_ip == $ban_ip)
{
die("You are banned from this site!");
}

// For a multiple user ban
$ban_ip = "xxx.xxx.xxx.1,xxx.xxx.xxx.2"); // put ip addresses, separated by commas
// DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING
$visitor_ip = $_SERVER['REMOTE_ADDR'];
$ip_list = explode(",", $ban_ip);
foreach($ip_list as $ip)
{
if($visitor_ip == $ip)
{
die("You are banned from this site!");
}
}

?>

منقول للافادة فقط

redman 22-10-2006 11:46 AM

بارك الله فيك اخي

درس جميل و نادر


جميع الأوقات بتوقيت مكة المكرمة. الساعة الآن » 12:31 PM.

Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © ArabWebTalk.Com 2004-2012