Help with URL containing multiple parameters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kendhal
Forum Newbie
Posts: 3
Joined: Thu Apr 24, 2008 4:27 pm

Help with URL containing multiple parameters

Post by kendhal »

Folks - I am a newbie to PHP and have the following problem:

I am writing a redirect script that redirects traffic to different URLs based on the user agent string. I am saving the URLs as variables at the top of the script. The URLs have multiple parameters separated by "&". My problem is that everything after the first "&" is ignored. For example:

$linkone = "http://www.somedomain.com/rd/r.php?id=4 ... 6&c1=link1";

PHP saves this URL in the variable such that it effectively becomes:

"http://affiliate.admtracker.com/rd/r.php?affid=400075"


All I am doing at the end is redirecting to the link variable:
header("Location: ".$linkone);

Thanks!

KD
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Re: Help with URL containing multiple parameters

Post by mchaggis »

There is nothing wrong with the way in which you are doing it as I use that method all the time.

If you do die("Location: ".$linkone); instead, what does it output? This will determine if there is actually something wrong with your PHP code or if your browser is doing something odd
Post Reply