I cobbled the following together to echo in the target in a ppv campaign.
$t202kw=$_GET["t202kw"];
$sitename = substr($t202kw, 0, stripos("$t202kw", "/"));
if ($sitename) echo $sitename; else echo 'Mydomain.com'; ?>
The goal being that if the t202kw=Amazon.com/blah/blahblah1890819.php it will still track this deep linked keyword but to the consumer will present Amazon.com
This works. However due to the nasty stripos thing it relies on the presence of the slash to work, if just a root domain target like Amazon.com is used sans slash it defaults to Mydomain.com
I know I should be using a regular expression, can anyone help me with one please? The goal being if domain.com to get this, and if domain.com/boah/falksdjf.html to get domain.com only and if BLANK to echo 'Mydomain.com"
Thank you
$t202kw=$_GET["t202kw"];
$sitename = substr($t202kw, 0, stripos("$t202kw", "/"));
if ($sitename) echo $sitename; else echo 'Mydomain.com'; ?>
The goal being that if the t202kw=Amazon.com/blah/blahblah1890819.php it will still track this deep linked keyword but to the consumer will present Amazon.com
This works. However due to the nasty stripos thing it relies on the presence of the slash to work, if just a root domain target like Amazon.com is used sans slash it defaults to Mydomain.com
I know I should be using a regular expression, can anyone help me with one please? The goal being if domain.com to get this, and if domain.com/boah/falksdjf.html to get domain.com only and if BLANK to echo 'Mydomain.com"
Thank you