An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
PHP file hosting question
#13550 01/04/11 05:35 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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:

Code:
<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:

Code:
    <?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.

Re: PHP file hosting question
ProTourist #13552 01/04/11 11:52 PM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
Free Web hosting sites make their money, most often, by inserting ads into the pages they host. I have never found any free hosting site that permits remote loading of content like what you're talking about here, whether it's PHP or not.

I suspect you'll likely find a great deal of difficulty finding what you want for free. Sorry!

What kind of content theft are you experiencing? I have a prblem with content theft all the time, but what I do is I find the place that's hosting the stolen content and send DMCA takedown notices to the Web hosts. That usually works very well.


Photo gallery, all about me, and more: www.xeromag.com/franklin.html
Re: PHP file hosting question
tacit #13553 01/05/11 01:20 AM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
Thank you for the reply, tacit.

The type of theft I've been experiencing is videos, photos, and my research and writing (text) being taken and redistributed at other web sites/blogs as if it were the work of another person (the host of that site). Occasionally attribution is given to me, but without my consent to use the content. I find videos popping up on YouTube containing my photos and videos and sometimes my writing too in the description area.

Preventing the thieves from viewing my blog has been helping a great deal -- it's a good defensive tactic -- it's just that the hosting sites for the PHP file that I've used so far have eventually stopped executing the file for me. I've signed up with another free hosting site this evening which can execute an uploaded PHP file, Agilityhost.com. It's working right now, but who knows for how long.

As mentioned previously I might be willing to pay a fee for the hosting of the PHP file -- if the host comes recommended and would cost just a few dollars a month. I'd also be happy to entertain another approach on blocking visitors by IP address which would work for a Blogger blog.

Any recommendations on a low-cost host for my PHP file?

Edit to add: my new free host has already stopped working -- only lasted a couple of hours. I really need a reliable host to execute the PHP file, even if I have to pay a hosting fee. Help?

Re: PHP file hosting question
ProTourist #13584 01/07/11 12:25 AM
Joined: Aug 2009
Likes: 1
Offline

Joined: Aug 2009
Likes: 1
How many IP addresses do you need to block?

In all honesty, I think the best solution is to host your own Web site on your own domain, rather than going with a free site like Blogger. That way, you get fine-grained, unlimited control over the IP addresses that are allowed to access your site, and you can write HTML to take other steps to protect your content. (One particularly clever tactic I've seen is a PHP script that takes a photo, slices it into a dozen or so pieces, reassembles it on the Web page, then puts an invisible GIF over it. People who try to steal the photo are reduced to taking a screen capture, which means they have to do quite a lot of work.)

I also recommend that you actively pursue infringers. Send DMCA takedown notices to YouTube or to the hosting company of any Web site that steals your stuff. I do this every few months; if you like, email me at tacitr (at) aol (dot) com and I can send you a sample of a stock DMCA takedown notice that you can fill out and use. Google-owned properties like YouTube respond quickly to DMCA takedown requests.

Like I said, I really doubt you're going to find a free hosting service that does what you want. As soon as they spot you remote-loading a PHP script, they're going to shut you down. I really, really think you'd be much happier hosting your own Web site.


Photo gallery, all about me, and more: www.xeromag.com/franklin.html
Re: PHP file hosting question
tacit #13640 01/09/11 08:56 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
Thank you for your time and suggestions for alternative solutions, tacit. As I mentioned a couple of times I was willing to pay a monthly fee if I could have found a reliable host for the PHP file; it did not have to be free. But it's true that Blogger has other secuity issues for me, beyond no built-in method to block unwanted visitors by IP address. I'm sure I could find the needed content-security by creating and hosting my own web site (already have my own domain) as you recommended, but such is far beyond my technical abilities. In fact, the "push-button publishing" of Blogger was known at times to push my abilities beyond their limits. My plan 'B' was to take my blog offline, to make it private, which is what I've ended up doing. Perhaps one day I'll write and publish a book on my subject instead, but it wouldn't have the rich media available in web publishing. Oh, well. Cheers.


Moderated by  alternaut, dianne, MacManiac 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.023s Queries: 24 (0.018s) Memory: 0.5944 MB (Peak: 0.6658 MB) Data Comp: Zlib Server Time: 2024-04-19 22:36:35 UTC
Valid HTML 5 and Valid CSS