January 2, 2009
By Martyn in PHP, Programming | 2 comments
If you would like to redirect browsers based on their IP the following method can be used to handle multiple IP’s. You can choose to redirect entire networks or a single ip.
<?php
//array of ip’s you wish to block. Note that you can block an
//entire class by replacing it with 0, so to block [...]
email this | tag this | digg this | trackback | comment RSS feed
August 25, 2008
By Martyn in Programming, Utilities | 0 comments
Most of our hosting servers run Centos Linux but we have Windows servers too and a problem common to both is the occasional high volume of traffic generated by non organic growth. I don’t mean that someones blog hits the front page of digg, rather a malicious or DDOS attack against a website. On shared [...]
email this | tag this | digg this | trackback | comment RSS feed
July 24, 2008
By Martyn in Programming | 5 comments
On more than one occasion these characters  have turned up just when everything else seems fine. Known as a “BOM” or Byte Order Mark they can be extremely annoying.
What is  ???
 is often seen at the top left corner of a web page. When you open the source file and compare that to [...]
email this | tag this | digg this | trackback | comment RSS feed
July 7, 2008
By Martyn in Programming | 0 comments
To remove stuff such as punction and spaces (or anything you want) from a text box before sending to the server for validation you can use code like this, first the HTML:-
<input
name="name"
onblur="this.value = entrycheck(this.value);"
type="text"
size="20">
And then the following Javascript will remove invalid characters when the user moves to another field:-
<script type="text/javascript">
function namecheck(theInput) [...]
email this | tag this | digg this | trackback | comment RSS feed
April 24, 2008
By Martyn in Hosting, Programming | 0 comments
It wasn’t long before I needed to expand upon banning a few IP’s. I needed to be able to ban whole networks so here’s the Q&D solution:-
First create a text file called ipsec.txt and enter some IP’s you wish to ban, to ban a network just leave off the end of the IP class [...]
email this | tag this | digg this | trackback | comment RSS feed