Hi there,

thanks for reading. I have the following problem. I switched from my old shopping cart using perl to oscommerce. My pay per clicks still come in on the following script and then are redirected by a small php file. Sounds confusing look here:

they come in at www.server.com/cgi/smart.cgi?listitems=whatsoever
and are redirected by the following code to there new php address in my oscommerce shopping cart. Until now there is no problem.

<?php require_once('./Connections/mydatabase.php');

mysql_select_db($database_server, $mydatabase);
$query_redirectLinks = "SELECT id, oldLink, newLink FROM oldLinks where oldLink='$string'";
header("Location: $new");

Now I integrated a javascript based tracking script to all my pages which gives me information on how the customer came to my site and what search term they used. But since the javascript can only be loaded in the body of a html it is not showing me the referrers here. The only referer that is picked up is my own site. Because the javascript can only be loaded in the page the customer is redirected to. i.e.
in this case someting like www.server.com/default.php?cPath=121

Please help me!! How can I integrate the javascript tracking code into that redirection page to pick up the original referrer and still redirect the page.

Thanks, thanks