hello. i wonder if it's posible to execute a php script when a page unloads. the page can be php or html. the main ideea was to execute it using javascript using <body onUnLoad=..> but i don't know how to do that. please help me if you know any solutions.
thank you
php execute onUnLoad
Moderator: General Moderators
Sorted! Replaced escape_Data() routine with this one... I've also put comments on lines where I made a mistake
Code: Select all
function escape_data($data)
{
if (get_magic_quotes_gpc()) //magic quotes is on
{
$data = stripslashes($data);
}
else //if (!is_numeric($data))
{
$data = mysql_real_escape_string(trim($data));
}
return $data; //return mysql_real_escape_string(trim($data),$dbconnect);
}huh??lamia wrote:Sorted! Replaced escape_Data() routine with this one... I've also put comments on lines where I made a mistake
Code: Select all
function escape_data($data) { if (get_magic_quotes_gpc()) //magic quotes is on { $data = stripslashes($data); } else //if (!is_numeric($data)) { $data = mysql_real_escape_string(trim($data)); } return $data; //return mysql_real_escape_string(trim($data),$dbconnect); }
back to the real issue....you're gonna have a tough time getting anthing to work using unload() as almost every pop-up blocker in the world will catch it and kill it...a horrible, but necessary death.