Pop in php..Displaying div after successful execution of php code

Hi All,

I have one have one problem please help me out in this.
I want to display pop in php. Like whenever user fills the form and submit it then after Successful submission of form if the data is inserted in database the it should pop up like Thanks for contacting this is ur enquiry number…blah blah…

Can anyone please help me with this that how can i show this pop or only div after successful insertion of data from php.

Awaiting for reply

after you check that the post was made then exit php and run the js code for the alert box and echo in any dynamic content. then open php back up and continue with the rest of the query.