Full IP protection (for hackers ect.)
I am creating my Habbo CMS from scratch, and my PHP is great.
But this isn't done, you can do javascript headers to redirect them to their site back(IP)
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == 'FILL IN IP HERE')
{
echo"SUM TEXT HERE Ā© DjInTrouble Protections 2010 - 2011.";
}
Dunot remove copyright.
For example, if you know my ip and you hate me, you can do this:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == '5.93.78.28')
{
echo"Sorry DjInTrouble, no permission for you.";
}
But don't remove copyright,please/
Like me if I helped:)
Re: Full IP protection (for hackers ect.)
Why not more, etc.
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == 'FILL IN IP HERE' || $ip == 'FILL IN IP HERE' || $ip == 'FILL IN IP HERE')
{
echo "Your ip is banned.";
}
Re: Full IP protection (for hackers ect.)
Yeah, that for example does work too.
Re: Full IP protection (for hackers ect.)
After the echo, why not put exit;
to stop loading more of the page? :P
Re: Full IP protection (for hackers ect.)
Hmm.. Tweeney I never thinked about that.
Thanks.
Re: Full IP protection (for hackers ect.)
uh, well done for mastering PHP. Even though I doubt this is your actual work. Problem is, is that IP bans aren't affective. They simply do not work or scale in the long run. Also, in the event of an emergency. I'd think it painstakingly slow and inefficient to have to SSH/FTP (whatever you do) to your 'ipban' file, add the IP address ect.
You should consider doing it in MySQL.
Re: Full IP protection (for hackers ect.)
Easier method:
PHP Code:
<?php
Define("BANNED", ""); // This could be changed to be MySQL results etc
Define("DO", 0); // edit this
If(in_array($_SERVER['REMOTE_ADDR'], explode(",", BANNED))):
switch(DO):
default:
echo "Permission denied.";
exit();
break;
case 1:
header("Location: http://127.0.0.1");
break;
endswitch;
endif;
?>
Sloppy PHP coding ftw
Re: Full IP protection (for hackers ect.)
And what's new with this? xD
- Martin
Re: Full IP protection (for hackers ect.)
why dont u use htaccess?
deny from 127.0.0.1
deny from 127.0.0
etc..
Re: Full IP protection (for hackers ect.)
Re: Full IP protection (for hackers ect.)
Hmm.. yeah but I hate it because I enabled it a time and emu doesn't work anymore. soo...
Re: Full IP protection (for hackers ect.)
What the fuck does the site have to do with the firewall blocking emulator, dumb ass. Yes, what Martin said "What's new with this".
Re: Full IP protection (for hackers ect.)
The standard Windows Firewall is a no-go. The "extended" one is much better. If you install the Routing and Remote Access service i think you get it. It can block subnets, block ip's, open ports, close all ports exept blahblah.
Edit: Thanks for this anyways, going to use it on my clan's homepage.
Re: Full IP protection (for hackers ect.)
Do you can make something that's blocking VPN connections?
Re: Full IP protection (for hackers ect.)
PHP Code:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if(mysql_num_rows("SELECT * FROM ip_bans WHERE ip = '".$ip."'");
{
die('Blocked');
}
?>
table ip_bans, field ip.
simple shit.
edit: o btw, in your first post, die(); it or it will load the page.