Category: Code

Using Adsense Section Targeting 0

Using Adsense Section Targeting

If you are getting lots of Groupon and Three ads on your adsense niche site the chances are it isn’t optimised correctly. By simply writing a short, keyword rich, snippet of what your site...

Custom wordpress 404 page for SEO 0

Custom wordpress 404 page for SEO

We have recently been purchasing used domain names from Godaddy auctions and Dropday. When we get the domains the first thing we do is look at what traffic they were pulling for what topics...

Mixing php with javascrip – Heredoc 0

Mixing php with javascrip – Heredoc

My main issue with javascript is the fact it is full of ‘ and ” which can be a real pain when coding. I’ve started using a method called heredoc to set a start...

Poor mans GeoIP – Quick and Easy Geolocation 0

Poor mans GeoIP – Quick and Easy Geolocation

//poor mans geoip $country=trim(file_get_contents(“http://api.hostip.info/country.php?ip=”.$_SERVER[‘REMOTE_ADDR’])); //You can then redirect customers to different offers depending on country. I wouldn’t recommend this for critical or high volume use. if ($country == ‘MyCountry’) { yadda yadda yadda; }

Two php functions for scraping content and extracting links 0

Two php functions for scraping content and extracting links

////// Grab webpage ////// function webFetcher($url) { $crawl = curl_init(); curl_setopt ($crawl, CURLOPT_URL, $url); curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1); $resulting = $resulting.curl_exec($crawl); curl_close($crawl); return $result = $resulting; } //////////////////////////////// //// extract links //// function extract_links($text) {...

Three ways to debug php 0

Three ways to debug php

Method 1 – error.log For this to work you need to be coding in a linux environment with php, apache etc setup. This is the best way I have found and what I currently...