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:
- Redesigning Custom Post Type “Add New” page
- Can we hook a static method of a class to add_action inside that class?
- Is there any record of installed plugins in the database?
- Being notified when some YouTube video in some post becomes unavailable
- Custom headers for the WordPress plugin directory
- Is it possible to run plugin code when a multisite blog is deleted?
- plugin wants to update to wrong plugin
- Trying to avoid including wp-load.php
- Stackoverflow type of badge plugin giving warnings in WordPress 3.5
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- How to add terms to a post depending on its title?
- What Triggers a Plugin Update Alert
- Make the plugin directory recognize new version numbers
- How to include admin-ajax when loading external javascript
- WooCommerce Dynamic Cart Pricing
- Remove action from a plugin class, forced to use global instance
- How to get last_updated and newest_blogs in WP 3.0
- WP Mail SMTP: What do the SSL/TLS options mean? [closed]
- How to create popup same as wordpress popup feature
- Moving WordPress from host without FTP?
- custom plugin – custom post type -Selectable options for User
- How to make first_name and last_name required fields in user profile?
- Security issues with WP sites
- How to add page using HTML, CSS and JS?
- Can we use a webservice with WordPress?
- WooCommerce get_price returning wrong price when used via ajax
- How I can get custom field’s current value?
- Using custom JS plugins with WordPress?
- How to resize images due to container width automatically server side/without CSS
- Checking instances of scripts in wp_head
- How to access data in wordpress database externally using php
- Add javascript to wp_head with call to plugin options?
- How to create a managed image repository in wordpress
- Anonymous Postings
- Using a function to change favorites listing
- how to add a button next to the wordpress view button?
- How can I prevent my plugin go development trunk [closed]
- (FES EDD) New vendor submission page is blank
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- After plugin activation all users marked as Spam
- How to create a code editor for my plugin .?
- Fatal error can’t activate a plugin [closed]
- How to pass variables to a function argument using add_action [duplicate]
- Identifying where plugins are being used in your wordpress install
- Activate my plugins via FTP
- How to check if my wordpress websiste is nulled or not?
- update_option_{$option} not showing old value
- How to get the particular product quantity in orders in Woocommerce [closed]
- Tutor LMS problem with Paid Memberships Pro [closed]
- A server-side hook failed when committing plugin code to SVN
- Best way to salvage a very old WP site
- Development of plugins to add components like JqueryUI
- Update WP option by plugin
- plugin enqueue style on all pages
- File Uploader – Upload without adding to Media Library
- why the wp_register_script doesn’t work for register_activation_hook
- Trying to include files in plugin isn’t working
- Table appears in Visual mode of editor but not in preview or after publish
- Pull comments from one page/post into another page/post?
- Do WordPress plugins suport multisite site?
- What’s the default setting for including a in a post
- Any gallery plugins that allow commenting on single images?
- How To Use do_shortcode with WooCommerce One Page Checkout
- Displaying page content from plugin, inside exising empty WP page
- GitHub plugins safe to use in my website?
- implement custom roles in custom plugin
- Update widget values from ajax function
- implement checkbox or toggle switch in plugin code
- how can export data in excel file custom plugin
- dbDelta not CREATING TABLE
- wp_mail in pluggable.php return path original settings
- woocommerce with external ftp site
- How to put a maximum real-time users limit
- How to exclude a part of a page in search results
- Help finding a plugin – masonry type post grid
- WP_CRON issue with UTC and local time
- Custom admin plugin read CSV
- How to get short description under heading – Visual Composer [closed]
- plugin installing error
- Get custom term link archive with prefix
- Plugin, add opengraph tags after form submit
- How woo-commerce store Product Data value in DB?
- How to save information related to post in database?
- Filter html of WordPress editor in visual mode only
- Creating a page that does not show up in the frontend navigation bar
- Second foreach loop breaking (Posts2Posts)
- Removing this filter added by a plugin
- Which filters or actions involve with index page for plugin?
- Infinite Scroll plugin on Ebuy theme
- Pronamic Info Window
- Gutenberg: Dynamic Block – Show saved data in the editor
- Trying to Understand Shortcodes.
- Is there a way to combine categories and their hierarchy into the admin listing page?
- How to delete Password Protected posts cookies when a user logged out from the site
- How to debug periodic performance issue
- wp_options Table keeps growing
- Run a function only once when logging into dashboard
- Stop the user if login from the cookies
- WordPress – How to add an attribute to a plugin inline script tag
- Randomly display activity posts on home page with buddypress