You don’t need to submit the form to the PHP script – the script simply needs to be included or required by PHP – this makes the code within it available to your entire application.
As Tom pointed out in his comments, there are security risks to this approach – but it is also not required – most PHP applications includes hundreds or thousands of files on each page load – the trick here is not find the secure and performant way to include your code in the right part of the page load flow.
As you want to capture POSTED form data, you need to check the $_POST object for the data you have posted from your form, then validate it and run additional sanity checks – and then process it.
Related Posts:
- How to eliminate weird 404 errors in wp-admin?
- Does WordPress contain “default” anti-SQL injection code that responds with a 404 error?
- How can I force a “404 Not Found” error
- Some plugins adding full server path after url (with custom wp-content folder)
- Why am I sometimes getting a 404 error when I try to update a page with Elementor?
- Getting a 404 when trying to load /wp-admin/plugin-install.php
- Show a special message for private page?
- What causes an Unexpected HTTP Error within install plugins?
- Error 404 using wpml plugin
- Custom Post Type Plugin not loading category template and loading 404 instead
- An issue with SEO Ultimate
- get 404 when accessing wp-admin/plugin-install.php
- Reoccurring 404 Errors on all subpages
- URL parameters causing 404 on home page, but nowhere else
- Some one is trying to hack my website, Need guidance [closed]
- wp-admin send 404 error
- Which filter/action should I use to serve content for “virtual” files
- Huge number of 404 pages getting spawned
- Pagination/404 I believe wp is getting a page ahead of itself
- How to detect 404 url and make this link underline or change background color?
- why is my wordpress not loading any images?
- All Post WordPress Page Error
- PageNavi redirects to 404 when used as archive page
- WordPress website dont load CSS, JS and images
- WordPress website giving 404
- Plugin with AJAX on subdomains causes 404 in console
- Getting 404 page not found error while trying to access add new plugin / themes
- homepage olderposts link showing page not found
- 404 Page when emptying spam or deleting a plugin
- Plugin Icon does not work correctly
- 404 Error on a WordPress Website, Error disappears for a while and again appears
- /wp-admin/plugins.php takes ages to load, and then 404s
- wp-login 404 page not redirecting to homepage [closed]
- Plugin Error – Not Sure Where to Go From Here
- Widget’s container?
- MediaElement.js works on one site but not the other?
- Customizing Titles on the Fly with Code
- Tools for styling code snippet in a web page
- wp_enqueue_style for plugin options page
- Popular Post With Thumbnail?
- Moving to a WordPress blog. What do I need to know?
- WP-nivo-slider Producing Error “Cannot modify header information – headers already sent by …”
- Is changing post from category in a large blog a good practice?
- How to keep track of new plugins published on wordpress.org?
- Contact Form 7 – Show image on successful send? [closed]
- Is this a plug-in in wordpress or a custom JavaScript
- What is generating Similar Posts and Related Posts on my blog?
- Default plugin config to override wp_options?
- Performance impact with inactive plugins? [duplicate]
- Best portfolio/gallery/carousel slideshow plugin with thickbox? [closed]
- Disable plugin only for one post
- Placing the two most voted posts at the top (in a WordPress site that uses the Vote it up plugin)?
- Is there any plugin which enables users to rate comments in thumbs up-down way?
- custom uploader in the admin area
- Plugin Repostitory Questions
- Timed content and flagging content as viewed by user?
- How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
- eLearning Module
- Add SideBar/Widgets Just Below the Post
- Amazon.com intergration with WordPress?
- How to best create a jQuery Slider to display a native wordpress gallery?
- Free paypal cart solution [closed]
- Best/Correct way to add an option to a category
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- “W3 Total Cache” with “What Would Seth Godin Do” (and widgets?!)? [closed]
- Add filter on html tags,attributes on specific function in wordpress
- XML Sitemap Generator can’t notify google and bing
- cforms plugin function “my_cforms_logic” (for writing custom logic), is running 5 times
- Adding rel=”nofollow” to external links in posts?
- Best Sitemap Plugin for 1M+ pages [closed]
- Collecting email addresses via a “beta” sign up form
- Plugin that provides the [edit] shortcode?
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- How to limit image size for the entire website ? But without editing the post (css/plugin?!)
- Problem installing plugin: unexpected T_STRING, expecting T_FUNCTION
- How do I get the Twitter Tools widget to display my tweets?
- Why are my WordPress store items showing up in duplicates?
- When I try to de-activate any plugin it gives error “Warning: call_user_func_array() [function.call-user-func-array]”
- Plugins for logo in wp themes? [closed]
- How to remove js ui library added by default by wordpress
- Is there a plugin for automatically adding a word or symbol after a trigger word? I.e. Like a search and replace but more like search and add? [closed]
- How to set category correctly for a custom post created by a remote API call?
- Can I do in-page changes binding events/triggers to actions in WordPress?
- Can inactive WordPress plugins still load scripts?
- What is the best way to cache pages on WordPress
- How to see which sites use my installed plugins (wordpress multisite)
- Product count in archive page Title in WooCommerce [closed]
- Use current class method inside add_submenu_page()
- how remove font to increase site speed load
- Plugin main file is constantly been fired on every website visit
- Why is Google Search Console getting X-Robots-Tag noindex?
- Website show Google Ads when we have no Google Ads linked to our website
- How to set “split_on_numerics” to false in ElasticSearch mapping using ElasticPress? (for proper SKU search in WooCommerce) [closed]
- Sticky option for custom post types without using custom fields or plugins
- My plugins are ending up above the header?
- Let users sell video in my website [closed]
- Change letters for day name
- Where should custom post types be registered in a plugin?
- Keeping and updating ACF and ACF Pro at the same time