This is not a Mac issue specifically, but I work on Macs and hope some fellow Mac users might have experience with this type of issue.
I have a blog, hosted by Blogger, and have been experiencing a big problem with content theft. I have Statcounter installed in the blog and have been able to isolate the IP addresses of undesired visitors. Being that this is a blog and not a regular web site, methods to block visitors by IP address are limited. I found via online searches one method that works well, but it involves using a PHP file that must be hosted elsewhere.
Code is added to the end of the 'header' section of the blog's template to call the PHP file, for example:
<script language='javascript' src='http://external.server.com/ipblockingscript.php' type='text/javascript'>
</script>
The PHP file which is hosted at the external server is coded like this:
<?php
/*
Blogspot IP address blocker.
*/
$iplist = array("11.22.33.44","22.33.44.55","33.44.55.66"); // the list of banned IPs
$ip = getenv("REMOTE_ADDR"); // get the visitors IP address
// echo "$ip";
$found = false;
foreach ($iplist as $value) { // scan the list
if (strpos($ip, $value) === 0){
$found = true;
}
}
if ($found == true) {
echo "top.location = \"http://www.google.com\";\n"; // page to divert to
}
?>
The PHP file is updated as needed to add IP addresses. The users whose IP address is included in the PHP file are diverted to google.com when they try to load my blog. When this works, it works very well.
The problem I'm having is identifying a reliable service, preferably free, to host the PHP file. Some free sites such as Google Sites and Free Webs appear not to work with executable files like this -- the file can be uploaded, but when the file is called from the code in the blog's template it does not execute, and when called directly from a browser (meaning, to paste the full path of the file into the address field of a browser, and enter it) the file just downloads.
I've tried two recommended free services that do host and execute the PHP file properly, 110MB.com and Byethost.com, but they have each worked well for a period of time and then stopped working. 110MB worked for about six weeks and Byethost worked for about two weeks. My accounts are not disabled, I can still log in and manage files, load web pages included in my account, download files, but the PHP file will no longer execute. It is possible that these hosts do not want this kind of activity and eventually disabled it.
I've tried posting questions at the site where I found this blocking method (a blog) but have received no replies after several weeks -- and the article itself says only that if one service to host the PHP file does not work, to try another service.
So my question is, can someone recommend a service, preferably free as my blog is free but low-cost might be possible, which should be able to host reliably a small PHP file like this, to be invoked from another site (my blog) and executed a few hundred times a day?
I am also open to another method to block unwanted visitors by IP address that would be successful with a Blogger blog.
Thank you.
P.S. I should add that I am not well-skilled with the technical side of the web. I am very unfamiliar with things like coding, scripting, and servers, so would appreciate any suggestions or recommendations to be explained in full detail and in the plainest language possible. Thanks again.