another question... i have a page called contest.php that consists of 3 different "steps" of the competition, so essentially the page is recalled 3 times before the person has successfully entered the competition. if a person clicks away from this page, then they will receive the warning message. i would like to track how many people leave the contest prior to completing all the steps. can i do this with onunload by inserting into a database when the page is unloaded? if so, how would i insert into a mysql database onunload?
You can't use onunload like that. An alternative would be to track how many people hit each step. For example, user reaches first step, database is updated, user reaches second step, database is updated... etc. You can then track how many people reached the first step, up to n steps, and subtract from the n step to determine how many people quit and at which step.