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! Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.