mlektra Posted December 12, 2009 Share Posted December 12, 2009 Hi guys. I am doing dynamic keyword instertion with PPV traffic. This is the link that trigger the landing page view on the network I am using. In that case it's AdOn Network. http://www.mydomain/rotator/?kw={SEARCHTEXT}{PARTNERID} For the sake of simplicity I will only say that I use the { } characters for better understanding in my prosper202 stats. I don't really HAVE to use those characters and that way. But I must find a way to differentiate the searchtext value (most of the time the URL visited by the user) and the partner ID. So when I check my stats, I see the keyword like this : {mydomain.com}{18857} But it could be [mydomain.com][18857] or mydomain.com[18857] or anything that can me differentiate the 2 values. The number is the ID of the "partner" that dispatch my traffic. AdOn is using several partner to distribute their traffic. So it help me to know which keyword URL/partner have made the conversion. Ok. But the real question is that I am using dynamic keyword insertion in my landing page with the <? echo $keyword; ?> string. I am inserting the keyword somewhere in the page mostly in that format : "Hey you {mydomain.com}{18857} visitor...." but I would need something more like : "Hey you mydomain.com visitor...." Since I need the string contain the data that way {mydomain.com}{18857} (or the other ways I showed you) is there a way in php or javascript to remove the { } signs + the {PARTNERID} variable? Is there a way to modify the <? echo $keyword; ?> string to do what I need ? Quote Link to comment https://forums.phpfreaks.com/topic/184887-tought-one-if-somebody-has-a-clue/ Share on other sites More sharing options...
wildteen88 Posted December 12, 2009 Share Posted December 12, 2009 There many functions available which can manipulate text. But wouldn't it be easier if you changed the format of your url to something like mydomain/rotator/?kw={SEARCHTEXT}&pid={PARTNERID} Now your keyword and partnerid will be completely separate variables, you'd get the keyword using $_GET['kw'] and the partnerid using $_GET['pid'] Quote Link to comment https://forums.phpfreaks.com/topic/184887-tought-one-if-somebody-has-a-clue/#findComment-976022 Share on other sites More sharing options...
teamatomic Posted December 13, 2009 Share Posted December 13, 2009 Easy one! $str = "{one}{two}"; $nstr=trim( $str ,"{}" ); list($domain,$referer)=explode("}{","$nstr"); echo "$domain--$referer"; Quote Link to comment https://forums.phpfreaks.com/topic/184887-tought-one-if-somebody-has-a-clue/#findComment-976374 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.