shayne54 Posted April 13, 2011 Share Posted April 13, 2011 Hey guys, I am not a coder at all and would love a little bit of help with my code not working. Basically, I have a redirect script that sends my visitors to a software download. I want to be able to track a snippet from the incoming refer and send it along with the download. I hope I am explaining this correctly. Here is my code: <?php $tid = $_GET["tid"]; header( 'Location: http://www.liutilities.com/affcb/?id=RBgendtd&aff=14231&xat=WU-<?php echo $tid; ?>' ); ?> The page that sends them to this script automatically adds ?tid={keyword here}. What the above script is supposed to do is grab tid and then put it after the &xat=WU- but instead, its only putting the actual code itself (&xat=WU-<?php echo $tid; ?>). Can anyone offer a suggestion? Thanks so much! Link to comment https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/ Share on other sites More sharing options...
dcro2 Posted April 13, 2011 Share Posted April 13, 2011 $tid = $_GET["tid"]; header('Location: &xat=WU-'.$tid); It's called string concatenation <<clicky. Link to comment https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/#findComment-1201251 Share on other sites More sharing options...
shayne54 Posted April 13, 2011 Author Share Posted April 13, 2011 So are you saying my code should look like this: <?php $tid = $_GET["tid"]; header( 'Location: http://www.liutilities.com/affcb/?id=RBgendtd&aff=14231&xat=WU-'.$tid); ?> thanks so much for your help BTW. Link to comment https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/#findComment-1201256 Share on other sites More sharing options...
kenrbnsn Posted April 13, 2011 Share Posted April 13, 2011 Or you can use: <?php header("Location: http://www.liutilities.com/affcb/?id=RBgendtd&aff=14231&xat=WU-{$_GET['tid']}"); exit(); ?> Always use the exit function after a "location" header to stop the script from executing further. Ken Link to comment https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/#findComment-1201259 Share on other sites More sharing options...
shayne54 Posted April 13, 2011 Author Share Posted April 13, 2011 Thanks so much guys for the help! Link to comment https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/#findComment-1201266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.