September 29th, 2006

Another SEO blog on the block!

I have just been made aware of the Apogee Search Marketing Blog, a fairly new but content-rich SEO Blog. Usually I'm skeptical when it comes to reading SEO blogs, as they tend be be heavily biased or opinion based. But this blog seems to be mainly an aggregation of the latest news items that relate in any way to SEO, so it actually appears to have some value!

Well, looks like it's another feed to add to my Google Desktop Web Clips panel…

September 29th, 2006

Ban visitors based on IP address with PHP

Most web hosting control panels allow you to ban IP addresses or ranges from your website. But if you don't have that capability provided by your host, here's the simple way to enable this through PHP:

$banip = array('127.0.0.1','127.0.0.2','127.0.0.3');
 
$ip = $_SERVER['REMOTE_ADDR'];
 
for($i=0;$i<3;$i++){
    if($ip == $banip[$i]) {
        echo "You are currently banned from this website, sorry!";
        die();
    } else {
        // carry on with site rendering
    }
}
September 29th, 2006

The answer to my Adsense woes

Web

To say the least, I have long been frustrated with the income generated from adsense on my sites. Currently I maintain 4 sites with adsense, and I generate at least 400-500 unique impressions per day. And how much do I make? All of about $1 per day.

Ok, so it covers my hosting fees, but it doesn't exactly compensate for any of the time I spend updating and posting to the sites. So, needless to say, when I read an article about the death of adsense, my curiousity was tweaked. I've now discovered this entirely new approach that enables bloggers to make money with their blog. It's called PayPerPost, and by the looks of things, I may be able to even make upwards of $10 per day if I pick the right blogging opportunities.

So I'm fairly optmistic right now, but it will take a few weeks of testing before I know for sure ;)

September 29th, 2006

Email form contents with PHP

Do you want to include a contact form on your website, but you don't know how to get the form information emailed to you? Well rather than using 3rd party components, you can easily use this PHP snippet to parse and email form contentst to the site administrator.

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$body = $_POST['body'];

// check for valid input
if ($name != "" AND $email != "" AND $body != "") {

  $sendto = "admin@yoursite.com"; //change to your email address obviously
  $subject = "Inquiry from yoursite.com";
  $message = "This is a message from your site:
                   From: $name
                   Email: $email
                   Message: $body"
;
  // send
  mail("$sendto", "$subject", "$message");
  echo "Your message was sent";
}
?>

and here's the simple html to generate the form

<form method="post" name="mailform" action="<?=$_SERVER['PHP_SELF'] ?>">
 
<table width="200"  border="0" cellspacing="0">
  <tr>
    <td width="62">Name:</td>
    <td width="134">
      <input name="name" type="text" id="name">
   </td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input name="email" type="text" id="email"></td>
  </tr>
  <tr>
    <td valign="top">Message:</td>
    <td><textarea name="body" cols="45" rows="10"></textarea></td>
  </tr>
</table>
  <br>
  <input type="submit" name="Submit" value="Submit">
  <input type="reset" name="Submit2" value="Reset">
</form>
September 29th, 2006

A seriously cool gift for geeks

Not too long ago, I posted information about a seriously cool piece of software called XAMPP, that allows you to run the LAMP platform from a memory stick. That post got DUGG, received some serious attention, and I'm still just as thrilled about it.

However, today my fascination with the idea has been taken to a new level. I ran across these Custom Thumb Drives, and now the idea is all the more improved. This company offers custom high-speed drives (yes, you can even choose feuschia you fiend), and they include free laser engraving in the aluminum case. Here's a photo:

So if I was to present my choices for coolest geek gifts, these little tools would be in the top 10 for sure (bundled with XAMPP of course!).

Next Page »