There is a file page template (page.php), there is a certain form processing script in it, but after sending the form (the action of the form points to the current page, that is, _ http://example.com/?page_id=1) after sending the data in the address bar the link remains on the current page, but index.php is requested, how can I make it so that when I submit the form I can process the data from the page.php file? As an option, process the data in index.php and redirect to the page, but somehow it’s not the best solution in my opinion
1 answer
I decided this in the following way: I created a form processing file in the topics, when I send the form, I’ll add a hidden field where the link to the current page is stored, after the data is processed, I redirect back to the page.
- By the same principle authorization is implemented in wordpress. There is a hidden field in the authorization form: <input type = "hidden" value = "PAGE_REDIR" name = "redirect_to"> This is normal. If you don't want redirects, use ajax-requests - RaZik
|