the fucntion (now I temporarily call it functioname) puts a small code:
if (confirm(“Are You sure you want to exit?”)) return true
else return false
now you only need to put a bit more: what if you exit the page by clicking “Post Message” or “Cancel” ? well, you probobly know the answer, just insert a varibale like oktoexit=0, and clicking either Post or Cancel updates its value to 1. The function will do nothing if this flag is on. (another simple ‘IF’ statement)
P.S – suggestion: allow non-registerd users to see (not more) SOMETHING… at least the new messages page. This will surely encourage more people to register.