If you ‘have’ to do it this way, you should add the following line to the top of your above your include functions line:
require('/path/to/yourdomain.com/httpdocs/wp-blog-header.php');
global $wpdb; // In case you need DB calls also
@milo is correct though and you should think of a better way of doing this…
Alternatively, you could look at Gravity Forms or Contact Form 7 plugins which both have in built validation and allow customisation.
Related Posts:
- How can I get $id variable in widget’s form function?
- Refresh page after form action
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- Add new user : make the fields First Name and Last name required
- How to call WordPress functions from a form processing script
- what is the meaning of settings_fields()
- update_post_meta for custom field not working upon form submission
- WordPress registration and contact form 7 [closed]
- Twenty Eleven Child theme error when attempting to use a rewritten function
- Gravity Forms – Using a Form to Pre-populate A Gravity Form [closed]
- Ninja form Redirect depending on text field content [closed]
- WordPress upload_mimes not working for front-end uploads of 3D files
- Ajax not working properly
- Fatal error: Cannot redeclare when switching themes
- Having a Function Inside of the Loop
- Removing custom meta data
- Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
- wp_nonce_field is breaking form for reasons unknown
- Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php
- Contact Form 7 If Condition
- How to properly refresh page after form action?
- Init action and refresh page after form action
- Specify multiple categories for custom post template – FATAL ERROR
- dynamic enquiry form [closed]
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Problems adding a new field to product in cart
- Its my first time trying to create a website , I got an error Please help
- Postback redirect through add_action is not triggered
- Warning and fatal error
- Button click counter for login user
- How to change form action of wp-login page with a function
- WordPress Ajaxifying not working properly
- Fatal error: Call to undefined function. Underscore me
- How to debug function file causing white screen
- Sending Messages Back to the Template After Processing?
- us states dropdown function and echo in theme template files
- Adding custom field in menu options [duplicate]
- update_usermeta don’t work
- Gravity Forms After Submission – GFFormsModel::update_lead_field_value?
- Fatal error after changes to functions.php, even with original file
- Will my WordPress site become vulnerable after adding this functions which allows more HTML tags for subscribers?
- Why functions metaboxes is causing White Screen in Admin [closed]
- Help finishing script to export WP user data when form submitted
- WordPress Custom wp mail template return full template
- Get all users from role and add to dropdown (select) – wordpress, javascript
- Can’t find function which is called in a wordpress theme
- CF7 Remove Comma from ‘select’ ‘radio’ and ‘checkbox’ outouts
- How to redirect using a custom wordpress api endpoint after form submission?
- Missing feature image link function
- What’s the difference between home_url() and site_url()
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove empty paragraphs from the_content?
- What is the “with_front” rewrite key?
- Why use if function_exists?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- Add multiple custom fields to the general settings page
- Ajax call always returns 0
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Solution to render Shortcodes in Admin Editor
- How to add a data attribute to a WordPress menu item
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- remove_action on after_setup_theme not working from child theme
- plugins_url vs plugin_dir_url
- Remove type attribute from script and style tags added by WordPress
- How to run a function every 5 minutes?
- Best way of passing PHP variable between partials?
- Upload Multiple Files With media_handle_upload
- How to display custom field in woocommerce orders in admin panel?
- Adding fields to the “Add New User” screen in the dashboard
- Issues with title-tag and document_title_parts
- How do I get the current edit page ID in the admin?
- How to check if a user exists by a given id
- Why isn’t is_page working when I put it in the functions.php file?
- Add tags to the section via functions.php
- Add image size if page template
- How to create a custom order status in woocommerce!
- Remove Actions/Filters added via Anonymous Functions
- Adding a second email address to a completed order in WooCommerce [closed]
- How to load parent_theme functions.php before child_theme?
- How to load scripts/styles specific for a page
- Programatically add options to “add new” custom field dropdown
- Is there any global functions.php file which works for any theme?
- Excluding iPad from wp_is_mobile
- When should you, and when should you not, use wp_list_pluck()?
- Get the ID of the page a menu item links to?
- Add container to nav_menu sub menu
- Difference between the_permalink() and get_permalink() function
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Child theme – Overriding ‘require_once’ in functions.php
- Link to user’s profile settings page?
- WordPress Enqueue for homepage only, functions.php, wp-framework
- get php variable from functions php and echo it in theme template files [closed]
- Get menu object from theme_location
- Is it ok to use a function to output the text domain name in a wordpress theme
- Displaying the number of updates available in the Admin area
- Trying to use add_action and do_action with parameters