Home >
POP / PPV / Redirect >
Using target on lander without domain TLD (5)
03-01-2012 10:08 PM
#1
andy_d (Veteran Member)
Using target on lander without domain TLD
For those who use the target/keyword on their landing pages, here's an easy way to make it look a little more legit if you see it fit within your landers.
Basically, if your target has a "." anywhere in it, it's going to split it up. This isn't flawless, especially if you're targeting subdomains. This will work for simple url targets such as:
something.com
something.org
something.net
It'll also capitalise the first letter..
Code:
if(isset($_GET["keyword"]))
{
$target = $_GET["keyword"];
$tmpArray = explode(".", $target);
$sitename = ucfirst($tmpArray[0]);
}
For the above examples,
something.com
something.org
something.net
$sitename will be equal to "Something"
You can then use
<?php echo $sitename ?> on your pages.
03-04-2012 06:17 PM
#2
presfox (Member)
for people copying and pasting the code, i would use <?= $sitename; ?> instead of what is posted above
03-04-2012 06:45 PM
#3
ackbar22000 (Member)
on same spirit, I used this, javascript :
Code:
re = /(\w*)(?:\.{1}[a-z]{2,3})(?![a-z])/;
domainName = re.exec(keyword)[1];
Whatever you feed it, it will return something.com, like "welcome something.com visitor"
I do regex when I'm bored. :-)
03-19-2012 11:03 PM
#4
robert75 (Member)
@andy...thanks for the tips I am going to test it out
03-21-2012 11:04 PM
#5
harrypotter (Member)

Originally Posted by
ackbar22000
on same spirit, I used this, javascript :
Code:
re = /(\w*)(?:\.{1}[a-z]{2,3})(?![a-z])/;
domainName = re.exec(keyword)[1];
Whatever you feed it, it will return something.com, like "welcome something.com visitor"
I do regex when I'm bored. :-)
cool!
anyway to get it to return something, instead of something.com?
respect to the regex master.
Home >
POP / PPV / Redirect >