Find Jobs
Hire Freelancers

BAN IP RANGE PHP SCRIPT (basic version)

$10-30 USD

Ditutup
Dibuat hampir 7 tahun yang lalu

$10-30 USD

Dibayar ketika dikirim
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 Proyek: 13998776

Tentang proyek

15 proposal
Proyek remot
Aktif 7 tahun yang lalu

Ingin menghasilkan uang?

Keuntungan menawar di Freelancer

Tentukan anggaran dan garis waktu Anda
Dapatkan bayaran atas pekerjaan Anda
Uraikan proposal Anda
Gratis mendaftar dan menawar pekerjaan
15 freelancer menawar dengan rata-rata $26 USD untuk pekerjaan ini
Avatar Pengguna
change if (strstr($_SERVER['REMOTE_ADDR'], $value)) { to if (strpos($_SERVER['REMOTE_ADDR'], $value) !== false) {
$25 USD dalam 1 hari
5,0 (534 ulasan)
7,9
7,9
Avatar Pengguna
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 dalam 1 hari
5,0 (12 ulasan)
3,9
3,9
Avatar Pengguna
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 dalam 1 hari
5,0 (7 ulasan)
3,9
3,9
Avatar Pengguna
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 dalam 0 hari
5,0 (2 ulasan)
1,6
1,6
Avatar Pengguna
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 dalam 10 hari
5,0 (1 ulasan)
1,8
1,8
Avatar Pengguna
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 dalam 1 hari
5,0 (2 ulasan)
1,7
1,7
Avatar Pengguna
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 dalam 1 hari
0,0 (0 ulasan)
0,0
0,0
Avatar Pengguna
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 dalam 1 hari
0,0 (0 ulasan)
0,0
0,0

Tentang klien

Bendera MALTA
Qawra, Malta
5,0
86
Memverifikasi Metode pembayaran
Anggota sejak Feb 7, 2010

Verifikasi Klien

Terima kasih! Kami telah mengirim Anda email untuk mengklaim kredit gratis Anda.
Anda sesuatu yang salah saat mengirimkan Anda email. Silakan coba lagi.
Pengguna Terdaftar Total Pekerjaan Terpasang
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuat pratinjau
Izin diberikan untuk Geolokasi.
Sesi login Anda telah kedaluwarsa dan Anda sudah keluar. Silakan login kembali.