Jump to content

PHP Tracking / Redirect code not working


shayne54

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.