[ip ban] Ipban tool

Gestart doorSmiegles23 reacties142 weergaven

24 berichten · pagina 1 van 2

Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke ik verveelde me dus hierbij een ip ban script :

code voor checken van IP ban. (wel de config include natuurlijk )

[COLOR= #0000BB]<?php
    $ip[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM ips WHERE ip="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ip[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700])
            {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]HOOOOOOOOOI , je bent verbannen 8D[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]welkom lieverd.[/COLOR][COLOR= #007700];
            }[/COLOR]
?>


mysql

CREATE TABLE IF NOT EXISTS `ips` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ip` varchar(100) NOT NULL DEFAULT ,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;


ip bannen admin

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]#########################
//Script by bitshosting//
#########################
 // config include ;)[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]))
    {[/COLOR]
    [COLOR= #0000BB]$check_if_already_exists[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM ips WHERE ip="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_if_already_exists[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] is al verbannen[/COLOR][COLOR= #007700]);
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO ips (ip) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]IP is verbannen![/COLOR][COLOR= #007700];
        }
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
    <form action="#" method="post">
        ip <input type="text" name="ip" />
        <input type="submit" value="Submit" />
    </form>[/COLOR][COLOR= #007700];
    }[/COLOR]
    ?>


met inlog systeempje

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
  [COLOR= #FF8000]#########################
  //Script by bitshosting//
  #########################
  // config include ;)[/COLOR]
  [COLOR= #0000BB]$wachtwoord[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]ditisjantv[/COLOR][COLOR= #007700];[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]admin[/COLOR][COLOR= #007700]] &&[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]admin[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
      {[/COLOR]
      [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logout[/COLOR][COLOR= #007700]]))
        {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent uitgelogd[/COLOR][COLOR= #007700];[/COLOR]
        [URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();
      }[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]))
    {[/COLOR]
    [COLOR= #0000BB]$check_if_already_exists[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM ips WHERE ip="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_if_already_exists[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #DD0000]0[/COLOR][COLOR= #007700])
      {[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000] is al verbannen[/COLOR][COLOR= #007700]);
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
      [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO ips (ip) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ip[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]IP is verbannen![/COLOR][COLOR= #007700];
    }
  }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
  <form action="#" method="post">
    ip <input type="text" name="ip" />
    <input type="submit" value="Submit" />
  </form>[/COLOR][COLOR= #007700];
  }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
  [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]]))
    {[/COLOR]
      [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]]))
        {[/COLOR]
          [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]wachtwoord[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]$wachtwoord[/COLOR][COLOR= #007700])
            {[/COLOR]
            [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]admin[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #DD0000]1[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]u bent ingelogd[/COLOR][COLOR= #007700];
            }
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
          [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft niks ingevuld[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
  <form action="#" method="post">
    wachtwoord <input type="text" name="wacgtwoord" />
    <input type="submit" name="login" value="login" />
  </form>[/COLOR][COLOR= #007700];
}[/COLOR]
    ?>
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Verkoop je het? Wat bedoel je?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sandcool schreef:
Verkoop je het? Wat bedoel je?
Hij geeft het gratis aan ons.
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ah leuk.
Ik zou het wel willen. Ik weet alleen echt niet hoe dat werkt sadley
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sandcool schreef:
Ah leuk.
Ik zou het wel willen. Ik weet alleen echt niet hoe dat werkt sadley
Het zijn gewoon 3 bestanden die je kunt kopieren?
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Weet ik, maar ik weet niet waar ik moet zetten biggrin
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jammer dat hij niet met tijd gaat, en zelf unbant.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nickjexx schreef:
Jammer dat hij niet met tijd gaat, en zelf unbant.
Dat kan je zelf simpel inbouwen ?
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maartenl schreef:
Eerdere citaten tonen
Nickjexx schreef:
Jammer dat hij niet met tijd gaat, en zelf unbant.
Dat kan je zelf simpel inbouwen ?
Dat heb ik al eens gemaakt/ik gebruik het ook, maar het is jammer dat hij dat er niet in heeft gemaakt voor mensen die het niet zelf kunnen. yummie
Verder simpel/effectief scriptje.
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

2 kleine dingen, mysql_num_rows returnt resultset of een boolean, je hoeft er dus geen string van te maken.
En je kan beter die() gebruiken, vind ik dan, want dan hoeft je niet aan de einde van de pagina een } tezetten.
Bijv.

if(.....)
{
die(jij hoort hier niet thuis.);
}

Verder netjes smile
0
Berichten
788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mooi script.
Ga het waarschijndelijk wel gebruiken.
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mensen die nog andere leuke dingentjes willen?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Wouterr schreef:
2 kleine dingen, mysql_num_rows returnt resultset of een boolean, je hoeft er dus geen string van te maken.
En je kan beter die() gebruiken, vind ik dan, want dan hoeft je niet aan de einde van de pagina een } tezetten.
Bijv.

if(.....)
{
die(jij hoort hier niet thuis.);
}

Verder netjes smile
die() is juist slechter. Als je die() gebruikt dan voer je niks meer uit wat onder die regel staat. Dus ook geen layout o.i.d. mocht je dat wel willen.
0
Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Ik zelf vind dat banned mensen geen recht hebben op iets moois..
Maar dat is een mening.
0
Smiegles

Lid · Topicstarter

Berichten
4.912
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wouterr schreef:
Ik zelf vind dat banned mensen geen recht hebben op iets moois..
Maar dat is een mening.

ik weet niet hoor maar als ik iets maak gaat het niet alleen om de mensen die recht hebben op iets moois maar ook om de basis van mijn script.
ik wil gewoon een netjes en goed te lezen script .
en dan is alleen maar die(); voor mij geen oplossing.
als bij jou het script niet boeit Oke,
maar dan krijg je een slordig eind resultaat.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren