IP Banning: Is it possible by uploading a script.

  • 2
  • Question
  • Updated 7 years ago
  • Answered
I.P Banning: i was wandering if this is possible by uploading a script to the file manager.

Please have one of your engineers if you do not know this answer, research this.

Thanks,
Nick

here's the script:

<?php
$banned[0]="ip address 1";
$banned[1]="ip address 2";
$banned[2]="ip address 3";

if (in_array($_SERVER['REMOTE_ADDR'],$banned))
{
echo "You have been banned from this site!!!";
} else {
// Stuff to display if user is accepted
}
?>
Photo of nick

nick

  • 154 Posts
  • 1 Reply Like
  • happy

Posted 9 years ago

  • 2
Photo of Marije

Marije, Official Rep

  • 4636 Posts
  • 237 Reply Likes
Hi Nick,

IP banning is something that can only fully be implemented at the server level, and it is not something that Yola offers. IP banning is something we would caution against for a few reasons:

1. They are easy to get around for someone who is determined.
2. People share computers. If you ban the ip, you ban all the users.
3. You could end up banning thousands of users who share an ip address.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Here is a script to block ips from your website! But, Yola employees, how will I test it?I don't want to block mine because it might block me from the whole site and I would have to have Yola Support to go into it and delete the widget for me.

<!--

<script type="text/javascript">

// Block IP address script- By JavaScriptKit.com (http://www.javascriptkit.com)
// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/
// This notice must stay intact for use.

//Enter list of banned ips, each separated with a comma:
var bannedips=["23.23.23.23", "11.11.11.11"]

var ip = '<!--#echo var="REMOTE_ADDR"-->'

var handleips=bannedips.join("|")
handleips=new RegExp(handleips, "i")

if (ip.search(handleips)!=-1){
alert("Your IP has been banned from this site. Redirecting...")
window.location.replace("http://www.google.com")
}

-->
Photo of origin of cookies

origin of cookies

  • 1 Post
  • 0 Reply Likes
i NEED to be able to ban ips because if people abuse the website by
e.g. swearing, offending others, hacking etc,etc
my website'll fall. it's supposed to be a friendly social website.
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
You are welcome to try this code if you wish, but this is not a feature we support.