Your verify.php
files lives outside WordPress framework, so $wpdb and everything else is not available.
Correct way is to use admin_post_
hook. You can read about it here.
This goes in functions.php
add_action( 'admin_post_add_foobar', 'prefix_admin_add_foobar' );
function prefix_admin_add_foobar() {
//$wpdb->update()
}
And the form:
<form action="<?php echo esc_url(admin_url('admin-post.php')); ?>" method="post">
<input type="hidden" name="action" value="add_foobar">
<input type="hidden" name="data" value="foobarid">
<input type="submit" value="Submit">
</form>
Simpler but not recommended solution is to init WordPress inside your verify.php
file, at the top add (replace ../../../ with correct path to the file):
require_once('../../../wp-load.php');
Related Posts:
- What is this JavaScript “require”?
- Oracle SQL query for Date format
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Can I have multiple primary keys in a single table?
- How can I make updates to a site, on a development copy, but then move updates back without overriding live site’s evolving database?
- get_results using wpdb
- wpdb->insert multiple record at once
- How to migrate a HTTPS WordPress installation to localhost?
- Database connection close
- How to monitor server for error establishing a database connection
- How to create bulk page and content? [closed]
- Importing posts from old website to new conflicting post ID’s?
- Connect to remote database using Localhost install
- remove missing image attachments
- Transient RSS feeds in wp_options not removed automatically?
- Best way to move live site local
- The revisions table in my database is at 70% capacity and growing. What should I do?
- WordPress for a very large website
- How to ensure data consistency in WordPress
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- WP_list_table bulk_action get edit and delete
- How to display data from custom table in wordpress database?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- How to diagnose and keep in check encoding issues?
- Add search Value to wp_list_table pagination
- stdObject stored in database. How does one convert it to usable format?
- I have a table I created, how do I make a form for a user to filter the data?
- What ALL can cause “Another update is currently in progress.”? [closed]
- Trigger Plugin database update after git pull
- wp_redirection_404 table has grown to 7GB
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- Cannot update custom database table row
- Change WordPress prefix for only one table?
- Two websites one database, administrator not working on second website
- Multiple wp_options tables to share content across installs
- Select two sums with single get_var statement
- How to get the SQL of the changes made to the database from an update or upgrade?
- Is there a smart way to obtain a list of only some selected user meta data?
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Permit Login if table row exists
- Make an Items attribute searchable (taxonomy using existing attribute)
- What would Repair and Optimize WordPress Database do?
- Store partial database to an archive database time to time
- Saving zero as meta value
- Migration: Copying database content to a different server
- Query multiple tables at once?
- Transferring/Uploading Data from DB to WordPress
- How to convert srcset links from https to http?
- How to get a list of WordPress default database tables?
- Delete all posts that do NOT have a specific tag
- Changing order of db results when encoding to JSON
- How to transfer from localHost to live but use the already existing database on the server?
- Backing up WordPress database and files
- Creating and Using Tables in the WordPress Database
- How not to display ALL items of a database
- Connect a membership plugin to an external database
- How to get the records from start with A to G in php and mysql
- Storing user’s data on external database on other server
- Link multiple user databases together?
- is it right choose to connect database in template page directly in WordPress site?
- How to insert a value to decimal type field using wpdb->prepare?
- I wanted to Know that how can I give ingore to 0000-00-00 in my config file
- Set a cron job to delete a specific database table table every midnight
- Two separate wordpress installations at one domain
- Is there a way to edit the WP content database in an admin panel or external page?
- Can we store password in without being hashing?
- SQL database import #1046 error
- Get all top categories, then only 3 posts for each
- Having all “non-PHP” files on a different server
- Error establishing a database connection in wordpress
- Where is the HTML-handler part in the wpdb class?
- Finding a page holding a specific string/URL that is used in the content
- “wordpress error in establishing database connection” and missing tables
- next comment id number wordpress
- Adding last value from Database as text in WordPress Page
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How can I get $wpdb to show MySQL warnings?
- About wp database hooks (error establishing connection)
- Database for JQuery Autocomplete field
- Auto populate form fields based on serial input or pull listings from other websites?
- How to extract some part of WordPress full source code
- Create Tables in WordPress
- Error establishing a database connection for some files
- Hash user emails in database?
- WordPress Failed to Login (DB Error)
- Share WordPress Database
- DB access blocked when initializing WP externally
- Saving data to database and exporting to excel
- Site does not work right, pages not showing up, even for root admin
- ERROR: “Table Prefix” must not be empty
- How do you build a database-centric site in WP?
- One information repeated on multiple locations on one site [closed]
- WordPress: Interact with Database Query Data and Login
- Attach posts based on category and position
- Showing Error(TAble already exist)
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]
- Cant Connect to Database
- WordPress database connection failed, while mysql client is working [closed]