Posted by Philip Ronan on 08/25/05 02:54
"Martin" wrote:
> Does anyone know a way to use the htm <body onunload=foo()> function
> to execute a php script without creating another window (popup). This
> has some real applications for tracking visitors and getting accepted
> by the google monster.
>
> I am simply trying to write (append) a file with information on exit
> from my web site. Seems like that should not be a big deal.
Change the offsite links so that they point to a local redirection script.
For example, change <A href="http://site2.example.com/"> into something like
<A href="/redirect.php?to=http%3A//site2.example.com/">.
In the redirect.php script, do whatever you have to, and then issue a
redirect header like this:
<?php header("Location: " . $_GET['to']); ?>
More info -> <http://php.net/header>
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
[Back to original message]
|