View Full Version : can this be done with asp ?

09-20-2007, 09:11 AM
I have page A where I have a form to fill out for users.
When submitting the form page A communicates to page B some data.

My question is, how can I make that whenever page A is loaded, in the background, another link should be accessed without the user knowing. (its for tracking purposes only) ?

Or is there a possibility of doing it with PHP ?

09-20-2007, 10:24 AM
It can be done, but since I don't know ASP I can't help you on that front. The PHP solution looks something like this:
// redirect.php

function starts_with($haystack, $needle) {
return strpos($haystack, $needle) === 0;

function abs_uri($uri) {
if($uri[0] === '/'
|| ($s = strpos($uri, '://'))
&& (strpos($uri, '/') > $s))
return $uri;
return basename($_SERVER['REQUEST_URI']) . '/' . $uri;

$p = abs_path($_GET['page']);
header('Location: ' . $p);
?>... then you just link to that page instead:
<a href="redirect.php?page=real%2fpage.html">Real Page</a>