PHP Simplicity Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The latest version of Simplicity oF Upload is 1.3.2.

Author Topic: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net  (Read 4741 times)

0 Members and 1 Guest are viewing this topic.

Martyn

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
    • View Profile
    • Smir.co.uk

NOTE: THIS IS A HACK! ITS NOT OFFICAL BY PHPSIMPLICITY
Just edit the index.php below the <?PHP section
For Multiple.
Code: [Select]
//Martyn - sfsj.net
//For a multiple user ban
$ban_ip = "xxx.xxx.xxx.xx1,xxx.xxx.xxx.xx2"; // 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!");
}
}
For Singular
Code: [Select]
//Martyn - sfsj.net
//For a singular user ban
$ban_ip = "xxx.xxx.xxx.xx1"; // 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!");
}
}
of course edit the 'xxx.xxx.xxx.xxx' with the IP you want banned. simple. but effective..
« Last Edit: August 02, 2009, 03:17:14 AM by Saleh »
Logged
Martyn

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #1 on: January 20, 2005, 10:00:23 AM »

simply great! :D
nice work martyn .. and it's simple as well ;)
I think it's time to add a hack section in my website ;)

and of course there is no different between the first and second code. it's just to clearify how to put multiple IPs..
Logged

We don't need a reason to help people

justin

  • Guest
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #2 on: April 02, 2006, 11:44:10 AM »

but how do i know a ip adres from a user :S:S ??? :-\
Logged

Martyn

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
    • View Profile
    • Smir.co.uk
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #3 on: April 02, 2006, 04:24:33 PM »

in the loggs dude?
Logged
Martyn

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #4 on: April 04, 2006, 06:31:00 PM »

but how do i know a ip adres from a user :S:S ??? :-\
you have to enable file logging or email notification and you will see the IP address of the uploader.

Hi Martyn, haven't seen you around lately! how are you doing? :)
Logged

We don't need a reason to help people

Martyn

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
    • View Profile
    • Smir.co.uk
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #5 on: April 04, 2006, 06:55:08 PM »

but how do i know a ip adres from a user :S:S ??? :-\
you have to enable file logging or email notification and you will see the IP address of the uploader.

Hi Martyn, haven't seen you around lately! how are you doing? :)
hey dude :P im fine, You??

still got each other on msn dude :P my names normal ŽMartyn or something :P

speak some time, :P

any luck on the watermarking yet?
Logged
Martyn

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #6 on: April 04, 2006, 07:21:17 PM »

I am fine, thanks :)
watermarking... hmm.. I was actually asked to do this for money! wanna pay? :P
Logged

We don't need a reason to help people

Martyn

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
    • View Profile
    • Smir.co.uk
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #7 on: April 04, 2006, 07:53:39 PM »

I am fine, thanks :)
watermarking... hmm.. I was actually asked to do this for money! wanna pay? :P
Ill pay you in love and kindness? :( and im always here to help people :P
Logged
Martyn

Saleh

  • Administrator
  • Full Member
  • *****
  • Offline Offline
  • Posts: 222
    • View Profile
    • PHP Simplicity
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #8 on: April 04, 2006, 08:15:03 PM »

LOL!! nah, if I ever do it paid, it wont be made for free for some time..
anyway, I do appreciate your helping others ;)
Logged

We don't need a reason to help people

Martyn

  • Newbie
  • *
  • Offline Offline
  • Posts: 41
    • View Profile
    • Smir.co.uk
Re: Simply Way To IP BLOCKING! Brought to you by Martyn - sfsj.net
« Reply #9 on: April 04, 2006, 08:18:33 PM »

LOL!! nah, if I ever do it paid, it wont be made for free for some time..
anyway, I do appreciate your helping others ;)
Wel i would like it if you made it crappy coding??

every one looking for IP banning i posted the easiest way possible :P ( should have charged :P )
Logged
Martyn
 

+ Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.
Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What is the answer to one plus one? (in numbers):