EliteHackers
SALUT 2022!! NE-AM MUTAT PE DISCORD ! Vrei să inviți un prieten? [T]eoria [H]aosului [C]ontrolat - https://discord.com/invite/U4HBCHzm7r Acesta aste link-ul oficial al acestui server.
Lista Forumurilor Pe Tematici
EliteHackers | Reguli | Inregistrare | Login

POZE ELITEHACKERS

Nu sunteti logat.
Nou pe simpatie:
Ela 22 Cluj la Simpatie.ro
Femeie
19 ani
Cluj
cauta Barbat
22 - 48 ani
EliteHackers / Scripting / [PHP] Ban IP From Visiting Moderat de Ad_Infinitum, AntiKiler, Puscas_marin, r3v
Autor
Mesaj Pagini: 1
Puscas_marin
Moderator

Inregistrat: acum 18 ani
Postari: 315
Credit goes to: Nath
This is a short tutorial on how to ban an IP address from your website.

Either create a new .php document in a text editor or add the following php to an existing .php document. (ex. index.php)

Code:

<?php
$ip = getenv('REMOTE_ADDR');
$blocked = "xx.xx.xx.xx"; // Replace the x's with the IP address.

if (ereg($blocked,$ip))
{
echo "You Have Been Banned";
exit();
}
?>

'echo "You Have Been Banned";'

* Now to explain the code.

<?php - Starts the php tag. Lets the browser know what language you are using.

$ip = getenv('REMOTE_ADDR'); - Gets the users IP address

$blocked = "xx.xx.xx.xx"; - Tells the browser that the "xx.xx.xx.xx" IP is blocked/banned

if (ereg($blocked,$ip)) - If the blocked/banned IP is the same as the users IP, the following echo will be displayed.

{ - Starts a bracket

echo "You Have Been Banned"; - Echos the "You Have Been Banned" line onto the page.

exit(); - Exit so no more content is ouput

} - Ends a bracket

?> - Ends the php tag


_______________________________________
Deci asa se fac banii....da clik sa vezi

pus acum 17 ani
   
Pagini: 1  

Mergi la