Wordpress form action send

have their own custom form in wordpress.

action=<?php bloginfo('template_url'); ?>/send_form.php"

on submit, it is always sent send_form.php but this php is intended to send the info-and style i canant with the theme ....

Is there a way to stay on the current page while it sends the information, prints and displays a message in the field that the form was successfully submitted.

Anyone have a suggestion for me?

+5
source share
2 answers

The answer to this question is quite in demand, and its correct adoption requires a little attention, but here are the main points of one approach:

  • , , action <form> : action=""
  • , . , $_ POST.
  • -, . , "send_form.php", , . , (, NONCE).
  • , . , " ". . PHP header() , .
  • , " ". , , , , .

.

- , .

+9

, "admin_post" (admin_post_YOUR_ACTION) "admin_post_nopriv" (admin_post_nopriv_YOUR_ACTION). (, )

: https://www.sitepoint.com/handling-post-requests-the-wordpress-way/

0

All Articles