0

I have written a small script go.php that takes the link parameter from the referring url and then redirects the user after a few seconds to that page.

For example the refferring url is:

http://www.site1.com/go/go.php?url=http://www.site2.com

The go.php script includes the following code:

<script type="text/javascript">
function movetopage(){
window.location = "<?php echo $_GET['url']?>"
}
</script>

<body onLoad="setTimeout('movetopage()', 3000);">

This works absolutely fine if the url I'm sending people to is a standard domain name.

But I want to refer it to an affiliate offer, and that affiliate offer also redirects in the form of:

http://site1.com/go/go.php?url=http://www.site2.com/redirector.aspx?aid=6352

Something is wrong, when go.php initiates the movetopage function to send them to the next link it returns a 404 and I'm guessing this has something to do with the second redirect.

Can someone please tell me how I can adjust the code to get this working, thanks!

Alan Carr
  • 322
  • 2
  • 9
  • 25
  • If you can paste `http://www.site2.com/redirector.aspx?aid=6352` in your browser and see it no problem, then you possibly spelled it wrong on the `http://site1.com/go/go.php?url=http://www.site2.com/redirector.aspx?aid=6352` or maybe the redirector.aspx script checks the referrer and ditches it if it is not a valid source. PayPer click links should not allow robot submissions and it could be that your movetopage function comes off as a robot to the redirector.aspx. – ndasusers May 12 '13 at 11:27
  • No that's not it, I haven't spelled anything wrong. When you go the url it is fine but using the go.php page it doesn't recognize the redirect. And the refferer is a valid source. – Alan Carr May 12 '13 at 11:45

1 Answers1

0

What if you just jump to it with PHP?

if(isset($_GET['url']))
    header('Location: '. $_GET['url']);
ndasusers
  • 727
  • 6
  • 12