Find Jobs
Hire Freelancers

BAN IP RANGE PHP SCRIPT (basic version)

$10-30 USD

Cerrado
Publicado hace alrededor de 7 años

$10-30 USD

Pagado a la entrega
Hello, I try to ban the following IP RANGES from my [login to view URL] page but they still enter my webpage. Those IPS are still tracked by statcounter (personal counteR) even when added at the end of my [login to view URL] page despite that the code below is at the TOP of the web page. Also, I need you to adjust the script below so I can define different redirection URLS for different IP ranges in same PHP code below. I will pay $30 for this easy job + great feedback if it works. Script to edit/modify: ----------------- <?php ob_start(); /* edit the $ip_range bellow to add or remove IP ranges you want to ban. If you want to ban IP ranges (1 to 3rd digit of IPv4 format prepend last digit with a dot) All array values must be enclosed in single quotes and separated by comma */ $ip_range = array('173.239.', '205.185.', '216.151.', '209.197.'); /* Edit bellow the URL where the banned visitor will be redirected. Values must be enclosed in single or double quotes */ $redirect_uri = '[login to view URL]'; /* Functionality bellow */ foreach ($ip_range as $key => $value) { if (strstr($_SERVER['REMOTE_ADDR'], $value)) { header('Location:' . $redirect_uri); } } ob_end_flush(); ?> ----------------- I look foward to hearing from you! Thanks Note: I don't need any admin area or whatever. I will edit the code myself from the [login to view URL] file.
ID del proyecto: 13998776

Información sobre el proyecto

15 propuestas
Proyecto remoto
Activo hace 7 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
15 freelancers están ofertando un promedio de $26 USD por este trabajo
Avatar del usuario
change if (strstr($_SERVER['REMOTE_ADDR'], $value)) { to if (strpos($_SERVER['REMOTE_ADDR'], $value) !== false) {
$25 USD en 1 día
5,0 (534 comentarios)
7,9
7,9
Avatar del usuario
I am a professional Web developer with an experience of more than 6 years in creating and customizing Web themes, extensions, application and plugins. My expertise is in providing high quality Web design and coding in very short amount of time. I take pride in my ability to produce results which pass the validation for XHTML and CSS as per W3C standards. In last 6 years I have successfully executed 150+ amazing Websites and 10+ Mobile Apps. I am well equipped in Magento, Wordpress, Opencart, PHP, MYSQL, js, JQUERY, PHP Frameworks, PhoneGap, Andriod, IOS and AJAX and designing through Adobe Photoshop, including HTML5, CSS2/3, Bootstrap (responsive sites). Regards Sahil Ahlawat
$25 USD en 1 día
5,0 (12 comentarios)
3,9
3,9
Avatar del usuario
Hello, It can be done using .htaccess file. You need to share full IP address which needs to block. Kindly drop me a message so we can discuss more details. Regards, Arpan Patel
$30 USD en 1 día
5,0 (7 comentarios)
3,9
3,9
Avatar del usuario
Hi there... I'm interested to this project and is available now to do the job. UPDATES: OK bid updates ... The script is already written and tested working properly. Looking forward for your response... Thanks.
$20 USD en 0 día
5,0 (2 comentarios)
1,6
1,6
Avatar del usuario
Hello, instead "$_SERVER['REMOTE_ADDR']," use this function to get client ip and everything should work function get_client_ip() { $ipaddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; else if(isset($_SERVER['HTTP_X_FORWARDED'])) $ipaddress = $_SERVER['HTTP_X_FORWARDED']; else if(isset($_SERVER['HTTP_FORWARDED_FOR'])) $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; else if(isset($_SERVER['HTTP_FORWARDED'])) $ipaddress = $_SERVER['HTTP_FORWARDED']; else if(isset($_SERVER['REMOTE_ADDR'])) $ipaddress = $_SERVER['REMOTE_ADDR']; else $ipaddress = 'UNKNOWN'; return $ipaddress; }
$25 USD en 10 días
5,0 (1 comentario)
1,8
1,8
Avatar del usuario
Hi There, I just implemented a similar system to test. I my counter did not increase. But will have to check how are you calling your counter for your case. But I can surely solve your problem within an hour or two. Regards, Sneha
$25 USD en 1 día
5,0 (2 comentarios)
1,7
1,7
Avatar del usuario
I think you must put "ob_end_flush(); die(1);" after Location header It will sure your page never render Or maybe statcounter use ipv4 and that client was ipv6 (if your server use ipv6)
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0
Avatar del usuario
I am a new on this website, but i know how to write this script. And I'll take the minimum price from you.
$20 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de MALTA
Qawra, Malta
5,0
86
Forma de pago verificada
Miembro desde feb 7, 2010

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.