Page 1 of 1

Get query for URL Rotator

Posted: Sat Mar 27, 2010 2:53 pm
by legionarius
usually i use this at the end of a link to pass the s,p,x,hid vars

index.php?S=<?php echo $_GET['S']?>&P=<?php echo $_GET['P']?>&X=<?php echo $_GET['X']?>&hid=<?php echo $_GET['hid']?>

but i now i am using a URL rotator and need to still pass these vars. How do i do that with the current script i am using:

Code: Select all

<?php


$sites[0] = array("www.mysite.com/index.php?", 5);
$sites[1] = array("www.myothersite.com/traffic.asp?", 1);

$countsites = count($sites);

for($i=0; $i<$countsites; $i++)
{
for($x=0; $x<$sites[$i][1]; $x++)
{
$mylist[] = array($sites[$i][0]);
}
}

$countlist = count($mylist);

$countlist = $countlist - 1;

$picker = rand(0, $countlist);

$picked = $mylist[$picker][0];

header("Location: http://" . $picked);

?>
Thanks
-Hector

Re: Get query for URL Rotator

Posted: Tue Apr 06, 2010 11:11 am
by andyhoneycutt
Maybe I'm missing something, but I don't believe you'd do it any different. Can you not attach the $_GET params to the end of the url you are redirecting to? For example:

Code: Select all

header("Location: $some_url?S={$_GET['S']}&P={$_GET['P']}&X={$_GET['X']}&hid={$_GET['hid']}");
exit; 
-Andy