Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 30th Aug 2008, 12:31 PM   #1
Active Warrior
War Room Member
 
Join Date: 2007
Location: , , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

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
Matthew Miele is offline  
Unread 30th Aug 2008, 02:38 PM   #2
Donald VanFossen
War Room Member
 
zerofill's Avatar
 
Join Date: 2008
Location: Upstate NY , USA.
Posts: 1,887
Thanks: 459
Thanked 652 Times in 299 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

<?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']);

Serp Shaker
The IM World Will Be Shaken to the Core!
Join my list at: IMCool.Biz
New Podcast --> podcast.imcool.biz

Last edited on 30th Aug 2008 at 02:43 PM.
zerofill is offline  
Unread 30th Aug 2008, 02:49 PM   #3
Active Warrior
War Room Member
 
Join Date: 2007
Location: , , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

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
Matthew Miele is offline  
Unread 30th Aug 2008, 03:03 PM   #4
Donald VanFossen
War Room Member
 
zerofill's Avatar
 
Join Date: 2008
Location: Upstate NY , USA.
Posts: 1,887
Thanks: 459
Thanked 652 Times in 299 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

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.

Serp Shaker
The IM World Will Be Shaken to the Core!
Join my list at: IMCool.Biz
New Podcast --> podcast.imcool.biz
zerofill is offline  
Unread 30th Aug 2008, 03:08 PM   #5
Donald VanFossen
War Room Member
 
zerofill's Avatar
 
Join Date: 2008
Location: Upstate NY , USA.
Posts: 1,887
Thanks: 459
Thanked 652 Times in 299 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

Originally Posted by Matthew Miele View Post

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
I guess what I mean is...if there is no referer...that $id value is probably empty to heh...unless I am not understanding something here?

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...?

Serp Shaker
The IM World Will Be Shaken to the Core!
Join my list at: IMCool.Biz
New Podcast --> podcast.imcool.biz

Last edited on 30th Aug 2008 at 03:10 PM.
zerofill is offline  
Unread 30th Aug 2008, 03:12 PM   #6
Donald VanFossen
War Room Member
 
zerofill's Avatar
 
Join Date: 2008
Location: Upstate NY , USA.
Posts: 1,887
Thanks: 459
Thanked 652 Times in 299 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

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.

Serp Shaker
The IM World Will Be Shaken to the Core!
Join my list at: IMCool.Biz
New Podcast --> podcast.imcool.biz
zerofill is offline  
Unread 30th Aug 2008, 03:27 PM   #7
Active Warrior
War Room Member
 
Join Date: 2007
Location: , , United Kingdom.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: Can someone check my PHP for me please - Double Meta Refresh Script
Share on: 
fb share twitter share gplus share more share

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
Matthew Miele is offline  
Closed Thread


Bookmarks

Tags
check, double, meta, meta refresh, php, redirect, referer, refresh, script, tracking


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:45 AM.