Okay I've got this script and it works everywhere else except when I call it from the OnUnload event handler. Can php be used with the OnUnload event handler??
Script is
<?php
function bob2()
{
$active_file = fopen ("active.txt", "r");
$active_old = fread ($active_file, filesize ("active.txt"));
$active_new = $active_old + 1;
fclose ("$active_file");
$file = fopen ("active.txt", "w");
fwrite ($file, $active_new);
fclose ("$file");
}
?>
<BODY OnUnload="<?php bob2(); ?>">
.......
.......
When I delete the above line of coding the webpage works as normal. Any tips?