Archive for the 'Uncategorized' Category

The 30 Day Challenge

WHAT IS THE THIRTY DAY CHALLENGE?

In a nutshell… The Thirty Day Challenge is about making your first $10 online. For a full 30 days we are going to be showing you exactly how to start your own Internet business and generate your first income online without spending a dime.

That’s right, this is going to cost zip, diddly, nothing, nada, ziltch. The entire training program is free, and you won’t have to spend a thing to get your business started and begin making money. No credit card required.

WHEN DOES IT START?

The 2008 challenge will commence on August 1st, but pre-season will start on the 1st of June. Sign up now by entering your first name and email address in the boxes above to receive updates and access to all the challenge training.

Sign up now

File include based on URL

While working on a project I found myself needing to dynamically include a snippet based on the URL. Doing this would allow me to keep a majority of my PHP code outside of my template, thus allowing me to easily redesign the layout when I needed to. Below was the result:

<?php
  $query_string = substr($_SERVER[‘QUERY_STRING’], 2);
  $match = preg_match(‘!fans/(.+?)/shows!’, $query_string, $value);
 
  $doc_root = $_SERVER[‘DOCUMENT_ROOT’].‘/’;
  $theme_path = ‘path/to/theme/’;
  $filename = ’snippet-’.str_replace(‘/’, ‘-’, $value[0]).‘.tpl.php’;
 
  $file = $doc_root.$base_path.$theme_path.$filename;
 
  if (file_exists($file)) {
    include($filename);
  } else {
    print $content;
  }
 



Bad Behavior has blocked 57 access attempts in the last 7 days.