James Bachini

Dynamically modifying the landing page with TrafficVance using php

I ran into a silly issue today when dynamically modifying a landing page using TrafficVance.

The script I was using was a pretty straight forward:

<?php
if ($_GET[‘t202kw’]) {
$kw = strip_tags($_GET[‘t202kw’]);
}

if(strpos($kw,’jetinternetmarketing.co.uk’) !== false) {
$page = ‘<h1>Dont target JiM on traffic Vance</h1>’;
}

?>

The problem was that the url I was using in Traffic Vance was

http://www.jetinternetmarketing.co.uk/lander.php?t202kw={KeyWord}

my target for example was:

jetinternetmarketing.co.uk

The script wasnt working because Traffic Vance was capitalising the first letter of every word. So $kw = ‘Jetinternetmarketing.co.uk’ and I wasn’t getting the match.

In hindsight I am guessing that if I had set the page in trafficvance to t202kw={keyword} then it may send through the lowercase target. (This is an assumption and untested)

Anyway to solve the problem I just added a strtolower command in and it worked great. Here is the full working script.

<?php
if ($_GET[‘t202kw’]) {
$kw = strtolower(strip_tags($_GET[‘t202kw’]));
}

if(strpos($kw,’jetinternetmarketing.co.uk’) !== false) {
$page = ‘<h1>We Love TrafficVance… Most of the time</h1>’;
}

if(strpos($kw,’wrongwithme.com’) !== false) {
$page = ‘<h1>We Love WrongWithMe.com… All of the time</h1>’;
}

echo $page;
exit;

?>

traffic-vance


Get The Blockchain Sector Newsletter, binge the YouTube channel and connect with me on Twitter

The Blockchain Sector newsletter goes out a few times a month when there is breaking news or interesting developments to discuss. All the content I produce is free, if you’d like to help please share this content on social media.

Thank you.

James Bachini

Disclaimer: Not a financial advisor, not financial advice. The content I create is to document my journey and for educational and entertainment purposes only. It is not under any circumstances investment advice. I am not an investment or trading professional and am learning myself while still making plenty of mistakes along the way. Any code published is experimental and not production ready to be used for financial transactions. Do your own research and do not play with funds you do not want to lose.


Posted

in

by