PHP help

we used to get customers from various sources.(ex: search engines). if customers land on our site from google then the URL will be http://www.test.com?ref=google&source=xxxxx. we need track those ref,source values and need to transfer to another site. there are about 50 static pages and in each page there are about 10-15 links. after landing on the site customer may navigate to other static pages. But at the end we need to somehow get the ref,sub values and append to the URL that redirects to another site. How can this done in PHP…?( or javascript)

Thanks,
Naru

You use the $_GET[’’] function. For example say you have the following URL: http://www.test.com?ref=google&source=xxxxx

You can use-
[php]<?php
$source = $_GET[‘source’]; //This now would be equal to XXXXX.
$ref = $_GET[‘ref’]; //This now would be equal to google.

//Then you can use links like
?>
New Site

<?php ?>[/php]

You can also make hard coded urls in the same way…
New Site

And still in the page the link goes to pull out those values.

another possibility is 2 use sessions.
then u may include just one line line at the top of every static page.

<?php include('googleref.inc.php'); ?>

googleref.inc.php:
[php]
session_start();
if(isset($_GET[‘ref’]) $_SESSION[‘ref’]=$_GET[‘ref’];

[/php]

and on the redirection page links u may use the $_SESSION values

Sponsor our Newsletter | Privacy Policy | Terms of Service