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
https://forums.phpfreaks.com/topic/233637-php-tracking-redirect-code-not-working/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.