Tuesday, February 20, 2018
Home Code

Code

A place for code php, ruby, javascript, jquery, html, css etc.

Coding PHP for Affiliates | A Getting Started Guide

Coding for me is one of the most important skills you can have as an affiliate marketer. I've met plenty of affiliates that are running huge volume, making millions and can't...

A simple iOS / Android traffic splitter in PHP

The following basic PHP code will split traffic by device with iOS traffic going to the first out link, Android to the second and leftovers to the third. <?php     $ua = strtolower($_SERVER);   ...

Regex’s | Regular Expressions in Programming

Today I saw a nice script which redirects mobile traffic by searching the useragent string for a list of search terms related to mobile devices. This is PHP but I'll show...

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...

Big list of Cordova/Phonegap Plugins

I needed a big list of Cordova plugins to search through: android.support.v4 This is a Cordova plugin that adds the Android Support v4 client library. It is meant to be depended on by...

Setting up Maxmind GEOIP2 Legacy Database with PHP or Javascript

This is the php code I use to access geoip data from Maxmind's geoip database: <?php $gpath = getcwd() . "/GeoIPCity.dat"; if (isset($_SERVER)) { $myip = $_SERVER; } if (isset($_SERVER)) { $myip...

Resize youtube/vimeo iframe to maximum available height and width

Here is the code to make a flexible youtube.com or vimeo.com video fit both the height and width of the containing div. Like a flexible adsense unit it will take up...

Rotating Offer Pages and Landing Pages in Prosper202

It is really easy to setup rotation of urls in Prosper but if you actually want to track which url is doing better or you want to test different landing pages...

Stupidly Simple AB or Multivariate Testing

Here's a simple way you can setup a simple multivariate or A/B split test without any software just using the subid variables provided by an affiliate network and some really basic...

Automatic Redirect for Mobile Landing Page

Want a mobile lander with a 90%+ "CTR"? Simply add the following javasript: <script> function go() { location.href = 'http://www.jamesbachini.com'; } function init() { setTimeout(function() { confirm('You have two friends who recommended this app'); },3000); setTimeout(function()...