The following function returns true if the current user is one of the bots we consider “good.” (Not that they are better than other legit bots, but ones that we provide a special service to)
This code can be used to allow search engines to index content that is normally behind a registration form. For a [...]
Posts Tagged ‘php’
Verifying search bots with forward and reverse DNS in PHP
Posted in code, wordpress, tagged dns, forward dns, googlebot, msnbot, php, reverse dns, slurp on April 29, 2009 | 1 Comment »
Checking IP Ranges for Sanity / Validity
Posted in code, tagged IP address, network, php, smr, validation on January 30, 2009 | 3 Comments »
This doesn’t cover a lot of cases so it is really a sanity check for IP Ranges. It takes two IP addresses a low one and a high one and makes sure they are valid IPv4 addresses and it take a look to make sure (at least I hope it makes sure, anyone want to [...]
PHP, split string in half / Insert into the middle of a string
Posted in code, tagged php, strings on January 25, 2009 | 4 Comments »
There’s got to be an easier way of doing this…. I wanted to harden an existing random password generator by insterting a random special character into the middle of the string. Task at hand: split string into two parts, left and right; return a string with the special characters in the middle of the left, [...]
