Well, I have a page with many forms and finally user submits those forms with some added code in text form.

I can redirect the user to the homepage when the mail is sent, but can I make in that way, that instead of redirecting to home page, just popup the small javascript based window to say that mail was sent successfully?

header("Location: .../index.html");
This is what I am using in PHP file to redirect to homepage after submittin