have an own customized form in wordpress.
action=<?php bloginfo('template_url'); ?>/send_form.php"
on submit, it goes always to send_form.php
but this php is for sending the info – and i cant style with with the theme….
is there a way to stay on the current page while it sends the info and print out and message in a field that the form has been sended succesfully???
anyone have some suggestion for me?
The answer to this is quite involved and getting it right takes a little care, but here are the essential points of one approach:
action
attribute in the<form>
tag to:action=""
That should give you a starting point.
If anyone else has a simpler solution, I’d love to hear it too.
If you want to do it through plugin instead of the theme, then use “admin_post”(admin_post_YOUR_ACTION) and “admin_post_nopriv” (admin_post_nopriv_YOUR_ACTION) actions. (Btw, you can use those actions through theme also)
Here is a good explanation: https://www.sitepoint.com/handling-post-requests-the-wordpress-way/