revjim.net

contactinfo code

A few people asked for the code to my contact info page. It’s not very complex. The hardest part was getting it to work within the bBlog template system. Of course, to make it easier, I’ve taken that part out. Here’s the code:

$oldnum = preg_replace('/[^0-9]/','',$_REQUEST['oldnumber']);
switch($oldnum) {
  case '2145551212':
  case '8175551123':
  case '9725559982':
    $ret = 'My new number is 4695554432';
    break;
  default:
    $ret = 'You didn't provide a valid number';
    break;
}

print $ret;

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>