![]() | | ||||||||
| | #1 |
| HyperActive Warrior Join Date: Sep 2007 Location: , , United Kingdom.
Posts: 161
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hey I have a double meta refersh in php to blank out the referer. But if the referer is not blank by the time it gets to the second page what happens? Could someone fix it so if its not blank it goes back to first page etc. here it is 1 === <?php $id = $_GET["id"]; echo "<meta http-equiv=\"refresh\" content=\"0;url=http://www.website.com/redirect2/?id=$id\">"; ?> === 2 === <?php $id = $_GET["id"]; $referer = $_SERVER['HTTP_REFERER']; if($referer == "") { echo "<meta http-equiv=\"refresh\"content=\"0;url=www.affiliatelink .com\subid=$id\">"; } ?> === Also, Is there a way to redirect it to different websites depending on location? example. If the offer im promoting only accepts US traffic is there a way for it to detect that its not US then send it through to the internation website etc. Thanks everyone Matthew |
| | |
| | #2 |
| Donald VanFossen War Room Member Join Date: May 2008 Location: Upstate NY , USA.
Posts: 1,996
Thanks: 271
Thanked 354 Times in 173 Posts
|
<?php $id = $_GET['id']; $referer = $_SERVER['HTTP_REFERER']; if($referer == "") { header("Location: http://www.affiliatelink.com/subid=$id"); } else { header("Location: http://www.website.com/redirect2/?id=$id"); } ?> Why don't you do it something like that? And as far as telling if it is U.S. or another country...you will need to use some type of geotargeting Out of curiosity...where is the value for $id coming from if there is no referer? heh...have to have id somewhere in the querystring that is coming in... PHP codeblock BBcode is causing an error for some reason so had to just post it in the message. Technically you don't need the $id=$_GET either you could just do header("Location: http://www.affiliatelink.com/subid=" . $_GET['id']); |
| Last edited by zerofill; 08-30-2008 at 03:43 PM. | |
| | |
| | #3 |
| HyperActive Warrior Join Date: Sep 2007 Location: , , United Kingdom.
Posts: 161
Thanks: 0
Thanked 0 Times in 0 Posts
|
ah thanks for that Donald! going to try it out! The ID comes from my actuall url so like www.mysite.com/?id=keyword1 So is the geotargeting something beond php? or something that you dont personal know? Thanks again |
| | |
| | #4 |
| Donald VanFossen War Room Member Join Date: May 2008 Location: Upstate NY , USA.
Posts: 1,996
Thanks: 271
Thanked 354 Times in 173 Posts
|
Well...the geotargeting you can get databases of...I imagine there are webservices out there etc...that you could make soap or xml-rpc requests to...I think even google maps api might have some type of geotargeting in it. You can buy databases that are updated to...Then you are just doing a check by the IP to your database...A lot of them are friggin expensive though heh. Just doing a quick search I see one for $50 and $12 for updates... Geolocation and Online Fraud Prevention from MaxMind Now I don't know who they are so you would have to research them or look around...probably a free database somewhere of them. Just probably not as current. I never had any reason to do geotargeting...but it would be easy with a webservice or a database. |
| | |
| | |
| | #5 | |
| Donald VanFossen War Room Member Join Date: May 2008 Location: Upstate NY , USA.
Posts: 1,996
Thanks: 271
Thanked 354 Times in 173 Posts
| Quote:
I understand your passing it via url...but the Referer is always going to be your site...once someone clicks on your link with the id value in the query string. Once someone clicks a link the referer changes. I take that back...I mean the $id won't be empty...but the referer will always be the same...or are you putting this link on multiple sites you mean? Like AdWords etc...? | |
| Last edited by zerofill; 08-30-2008 at 04:10 PM. | ||
| | |
| | #6 |
| Donald VanFossen War Room Member Join Date: May 2008 Location: Upstate NY , USA.
Posts: 1,996
Thanks: 271
Thanked 354 Times in 173 Posts
|
Nevermind...I am having a bad day lol... I am guessing you are probably pushing that from PPC right? And then sending them on again from a redirect...having a duh moment. |
| | |
| | |
| | #7 |
| HyperActive Warrior Join Date: Sep 2007 Location: , , United Kingdom.
Posts: 161
Thanks: 0
Thanked 0 Times in 0 Posts
|
haha basically every page contains the GET code and every link contains $id. So the ID is always passed from page to page. Even to the redirect page. www.mysite.com/redirect1/?id=123 etc |
| | |
![]() |
|
| Tags |
| check, double, meta, meta refresh, php, redirect, referer, refresh, script, tracking |
| Thread Tools | |
| |
![]() |