are we talking about a popup closing here or a page-form?
I think it's more or less possible to do with a popup, it would be very difficult to do with a page.
Generally speaking though, the form has "closed" and the user is going to another page. Yes you are doing some code on the server side, but you'd need to add the message to the "place you are going to" because the "place you are coming from" has already disappeared.
cheers
Bruce