For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > July 2006 > Re: correct format for .php&redirect=









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: correct format for .php&redirect=
yawnmoth

2006-07-30, 9:57 pm


stevebremermn@yahoo.com wrote:
> I'm working on setting up some affiliate links on a site of mine and I
> haven't been able to get a redirect to work.
>
> The original affiliate link looks like this:
>
> http://www.exampleurl.com/index.php?ref=10
>
> Rather than use this link however I am wanting to redirect to specific
> product pages. A product page link would look like this:
>
> http://www.exampleurl.com/example-p...-1-135_100.html
>
> In the past I have been able to easily set up a redirect link simply by
> combining the links with &redirect= such as:
>
> http://www.exampleurl.com/index.php?ref=10&redirect=
> http://www.exampleurl.com/example-p...-1-135_100.html
>
> I understand this is probably not correct for PHP. I did play around
> with it a lot to no avail, including the use of URL encoding. Thanks
> in advance to anyone with a suggestion. :)


It's hard to say much without being able to see the relavent portions
from your index.php file, but usually, you have to do something like
header('Location: '.$_GET['redirect']) and then exit shortly there
after. $_GET['redirect'] should, of course, be checked against a white
list, or at the very least, for characters like "\r" and "\n", to
protect against http response splitting.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com