You are here: Re: onunload is a great function but it generates popups! « PHP Language « IT news, forums, messages
Re: onunload is a great function but it generates popups!

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/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация