PDA

View Full Version : can this be done with asp ?



T-B0N3
09-20-2007, 09:11 AM
Hi.
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 ?

Twey
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:
<?php
// 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;
else
return basename($_SERVER['REQUEST_URI']) . '/' . $uri;
}

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