I've been digging around for this in the forums and can't seem to find any solution.
When bidding on PPV urls I'd like to be able to remove everything but the domain name
Example:
www.walmart.com
ww.walmart.com/?=
w.walmart.com/shop
walmart.c
would all show on the landing page as just: Walmart
Anyone have a script that can do this?
That would be great if someone can share something like this cus its really tedious to create a separate landing page for each target specially when you have a lot of targets this means a ton of work.
Ask and ye shall receive:
<?php
$target1 = $_GET['keyword']; // Replace keyword with whatever variable you are using i.e. kw / t202kw / KEYWORD
$target2 = substr($target1, 0, strpos("$target1.", ".")); // removes everything after the "."
$target = ucwords(strtolower($target2)); // CAPS the first letter i.e. changes apple to Apple.
?>
<?php echo $target?>
I'm confused - are you passing the target to the lander, but then wanting some manipulation of that passed url to just extract the domain name, so that you can use it in a broad sense for lots of different domains? If that's the case you should be able to do something with preg_match, I'll have a search for a bit. It can be quite complicated to have it deal with URLs in so many different iterations, TLDs etc.
I think he just wants to be able to dynamically put the name of the domain only onto his lander text somewhere. IE walmart.com would read Walmart in his lander. That's what the script I posted will do for him.
I love you jimcrim 
Hey Jim, I think your code won't work if he uses a subdomain. A regex here might be a necessary evil.
Something like:
[PHP]<?php
$target1 = $_GET['keyword'];
$target = ucfirst(preg_replace("/^(w*\.)*(.+?)\..*/i", "$2", $target1));
?>
[/PHP]
Ok yes, just to confirm the code pasted by jimcrim did not quite do the trick. (thanks tho)
The code hummer posted works perfectly.
So the winning combo is
Put this at the top of your page
<?php
$target1 = $_GET['keyword'];
$target = ucfirst(preg_replace("/^(w*\.)*(.+?)\..*/i", "$2", $target1));
?>
<?php echo $keyword?>
<?php
$target1 = $_GET['target];
$target = ucfirst(preg_replace("/^(w*\.)*(.+?)\..*/i", "$2", $target1));
?>
<?php echo $target?>
<?php
$target1 = $_GET['t202kw'];
$target = ucfirst(preg_replace("/^(w*\.)*(.+?)\..*/i", "$2", $target1));
?>
<?php echo $t202kw?>
Yo Jim, I believe its BOOM 
Sick thread here, that will help ALOT with conversions on PPV from experience, thanks Profitable!
LOL Maynzie, good to know! I'll be sure to stay away from Boom and stick to ripping off Emeril catch phrases, HA.
This is specific to the example he had. For you it'll be something like:
[PHP]
$otherdomains = "|blah\.";
$target = ucfirst(preg_replace("/^(w*\.$otherdomains)*(.+?)\..*/i", "$2", $target1));
[/PHP]
if you wan tot add another subdomain like for example for dreamy.justinbieber.com, just add |dreamy\. to $otherdomains
[PHP]
$otherdomains = "|blah\.|dreamy\.";
$target = ucfirst(preg_replace("/^(w*\.$otherdomains)*(.+?)\..*/i", "$2", $target1));
[/PHP]
Yes I know, it's messy.
This may be a little cleaner and I don't think you have to continue to add subdomains to the string:
[PHP]<?php
$target1 = $_GET['keyword']; // Replace keyword with whatever variable you are using i.e. kw / t202kw / KEYWORD
$test = substr_count($target1, '.');
if($test == 2)
{ $pat = '/\.([^\"]*?)\./';
preg_match($pat, $target1, $t2);
$target3 = $t2[1];}else{
$target2 = $target1;
$target3 = substr($target2, 0, strpos("$target2.", "."));
}$target = ucwords(strtolower($target3));
?>
<?php echo $target?>[/PHP]