Rather than include an HTML file, include a PHP file instead. Then, at the top of your PHP file you can check to see if any data’s been submitted and process it before displaying the form. So instead of what you have, try:
function show_hotel_dashboard(){
include 'dashboard.php';
}
Then on the page do things like:
<a href="https://wordpress.stackexchange.com/questions/1210/dashboard.php?action=do_something">Do something</a>
And in your dashboard.php
file, start with
<?php
if($_POST["action"] == "do_something") {
// Do something
} else {
// Output your regular dashboard page
} ?>
Related Posts:
- Get a list of all registered actions
- How can I force a file download in the WordPress backend?
- How to implement a customizable free OpenID authentication?
- What’s a reliable way to depend on another plugin?
- Woocommerce get cart total price in a number format [closed]
- How to tell if Jetpack’s Photon is active?
- Woocommerce – Hide “add to cart” on free products
- Is it good practice to remove redundant plugins and themes?
- What is the purpose of the “Hello Dolly” plugin?
- User profiles and object associations
- Generate Advanced Custom Fields box in custom admin menu page
- Share buttons on article footer
- change plugin shortcode function [closed]
- How to prepend to the_title for admin-side plugin’s use
- How can I retrieve data within my widget
- Custom data-id wp_enqueue_script
- Whats the difference between Page Builder Plugins and Theme Builder Softwares? [closed]
- Settings API – input always updates over validation
- Creating search filter through plugin
- Should I host support forum on wordpress.org or my own website?
- How to setup a Network Plugin across the network with only my settings?
- jQuery Plugin to use WordPress functions in AJAX request
- Can a plugin deactivate itself?
- Syntax Highlighting Plugins and 3.2.1
- Problem Building a Simple Google Maps Plugin
- Display content from custom post type if match to main post category
- woocommerce_order_status_completed action hook not working [closed]
- How to update billing_email when user_email is updated [closed]
- How to embed HTML code from WP Coder plugin (or other) into Main Index Template of the theme
- Which escape function to use when escaping an email or plain text?
- Multisite custom user activation emails – html
- Wp List Table – wpdb results are not displaying
- resetting permalinks after changing page names
- Edit Yoast SEO breadcrumbs output [closed]
- Admin accounts unable to see plugins from external IP
- WP ALL Import plugin – import data from certain ids
- Hide Elementor Templates Menu from Admin [closed]
- How to remove plugin metaboxes from edit.php
- WordPress wp-admin/network/plugin-install
- creating a custom shop page display on archive woocommerce
- Can’t delete the two native plugins of WordPress
- How I can internationalize variables within the function _e () __ (), etc?
- Plugin init hook fires repeatedly
- How to delete all trashed item in one-go
- How to update mu-plugin
- Hide a Menu Item on Login
- What are the performance hiccups when building plugins?
- Where is my google maps on my page? [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- plugin wraps the entire content
- How Do I Uninstall a Current WordPress Theme and Install a Fresh Theme
- How do I change where a plugin pulls updates from?
- Individual Comment Notification Setting For Post Author
- How programatically cause uploads folder to be created?
- Mass Mail Plugin to Email Specified User Roles [closed]
- Favorite recent post widget
- require_once not working in plugin wordpress
- Quiz with complex output/result
- Using Class loader in WordPress boilerplate
- Images not appearing after applying Smush
- Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
- Display value of the GET parameter in a new URL page
- How do I use a plugin’s shortcode attribute value in another function?
- Change the address of the music player if not available
- WordPress disable direct access of files in WordPress installation path
- $wpdb->insert not working inside save_post tag
- How to check for already existing plugin versions on activation? and prevent errors
- update_post_meta is not working for me when I use e.preventDefault for update button
- jQuery works instead of $
- WordPress create thumbnails on demand
- How user can download a specific file?
- How to get data from a private API and add it to wordpress pages
- Scheduled cron event removed from list automatically after sometime
- Geotargeting plugins never work
- Plugin management with my custom plugin
- How to allow editors to only edit certain categories?
- How to pass value from WordPress to Javascript
- How to get custom or filtered endpoints in WordPress API?
- Get not the full path
- Plugin communication between sites that use it?
- WordPress 4.1 plugin only save 1 field to database
- How to run my plugin only when the whole page is sent?
- WordPress custom posttype meta values doesnot save
- Why tinyMCE.editors doesnt work on tinyMCE
- Assigning a custom post type to a custom page
- get_var result empty for query of custom table in plugin admin
- WordPress include scripts and style in plugin page
- get_option include in my adsense
- woocommerce product categories in menu [closed]
- Book plugin to record books read and write my own reviews [closed]
- How can I make a website with dynamic features with wordpress?
- Change page content based on dropdown selection
- How can I properly sanitize the update_option in WordPress?
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Why is my menu page not being displayed?
- WordPress User Registration/ Sign Up -> Able to take Paid Certification Courses & keep track of Completed Certificates
- Prevent primary navigational menu from expanding during page load (WordPress / Astra Theme)
- Issues with creating user profile for a subscriber, but with different profile page and functionalities
- Block Root REST API Route using custom &/or iThemes
- How to set an exact search box in tablepress plug-in