Blog Madness

e-Marketing tips

Monday, July 29, 2013

CNAME Lookup Tool

Web based tool to check if your CNAME record was set up correctly:

Simply enter your custom domain in the 'Domain Name' field and click 'CNAME Lookup'.

Alternatively, you can use Kloth's Dig Tool.

Tuesday, February 26, 2013

Executing large PHP scripts.

  • A PHP script executed from the command-line or from a shell script, cron job, etc. does not have a timeout by default.
  • You can also set a PHP script's timeout dynamically with the set_time_limit() function. Beware: set_time_limit() has no effect when PHP is running in safe mode.

Wednesday, February 6, 2013

Creating Dynamic Virtual Hosts Using .htaccess

Good post on how to dynamically allocate the virtual host directory based on the host name.

Saturday, February 2, 2013

Only show ads if a visitor comes from a specific site

Scenario:

  • You are running Wordpress.
  • You only want to show specific ads to visitors coming from the domain foobar.com and google.com.

Code:

In your functions.php add:

function fromspecificsite(){ $ref = $_SERVER['HTTP_REFERER']; $SITES = array('foobar.com', 'google.com'); foreach ($SITE as $source) { if (strpos($ref,$source)!==false) return true; } return false; }

In your template add:

if (function_exists('fromspecificsite')) { if (fromspecificsite()) { echo "your ad code"; } }