I början av Januari 2014 låstes Whoa och du kan alltså ej logga in eller skriva något nytt i forumen. Innehåll i forum osv kommer finnas tillgängligt. Läs Mer »

Lägga till ett spärr script i PHP ?

Hobby & Fritid - Datorer & Teknik

   
Producent

2006-05-09 15:13

Lägga till ett spärr script i PHP ?

Går det på något sätt lägga till en spärr mot vissa ip adresser i ett existerande php script, problemet i min gästbok på min sida är det något automatiskt spam från ett speciellt ip nummer som jag gärna vill blocka.
Då menar jag någon lätt spärr som är enkelt att implentera.

Since 1984
@realgizlee // twitter

2006-05-09 15:18
micKillah P21
är det ett och samma IP som det spammas från varje gång eller vill du blocka en hel IP-serie?
"Skiing without avalanches would be the perfect sport. On the other hand it's what makes it fun."
Producent

2006-05-09 15:21
det är ett och samma hela tiden ja ...
Since 1984
@realgizlee // twitter
Producent

2006-05-09 15:22
implementera
Since 1984
@realgizlee // twitter

2006-05-09 15:36
typ...

<?php
// Få fram IP.
$ip = $_SERVER;

// Blockade IPn.
$deny = array("xxx.xxx.xx.x","xx.xxx.x.xxx");

if ( array_search($ip, $deny) === true ) // user isn't welcome.
{
// Skriv ut någon rolig text och blocka
exit("User - <span style=\"color: red;\">Jurgårdare!!!</span>");
}
?>

"Skiing without avalanches would be the perfect sport. On the other hand it's what makes it fun."

2006-05-09 15:37
fö så suger jag på php...
"Skiing without avalanches would be the perfect sport. On the other hand it's what makes it fun."

2006-05-09 15:49
det där fungerar inte. för att få ip blocken å funka måste du strippa IP Adressen från punkter innan den sparas och jämförs annars vill inte PHP jämföra adresserna ordentligt.
" Everyone interprets everything in terms of his own experience. If you say anything which does not touch a precisely similar spot in another man's brain, he either misunderstand you, or doesn't understand you at all. "

2006-05-09 15:53
"Skiing without avalanches would be the perfect sport. On the other hand it's what makes it fun."

2006-05-09 16:25
går ju att fixa med endast ett par rader. sitter på mobilen nu, kan trolla lite senare om ingen hunnit före ;)
Den narkotika som vi får in i Sverige kommer ju ofta från andra länder.
Laila Freiwalds
Producent

2006-05-09 16:40
ska prova det där och blocka mig själv o se om de funkar
Since 1984
@realgizlee // twitter
Producent

2006-05-09 16:47
nopes, de inte funka
Since 1984
@realgizlee // twitter
Producent

2006-05-09 16:54
den andra länken funkade, tackar :)
Since 1984
@realgizlee // twitter