In my website, i have a div with links and a div where i display the contents of the pages when corresponding link is clicked. Now i have a form which on submitting mails the data using mail() and displays that message is sent if mail() is successful. But the issue is that on submit, it sends the data and loads the page submit.php in the window. Instead of that i want the result to be shown in my contents div only.
I have browsed the net for the answer and found a lot of solutions, all using different ways.
I want to know which is the best way to do that.. which is most efficient?
note:the solutions i got were:
1) to make a ajax call jquery submit form and then show results in an existing div
2)making xmlHTTPheader request using javascript Submit form values to a script without loading a new page
3)using success handler and javascript show div on form submit with no redirect
4) make another redirect on the php script to the website