Insert data in database using form
The two variables $name and $email are unknown inside the function. You have to make them globally available inside it by changing global $wpdb into global $wpdb, $name, $email: require_once(‘../../../wp-load.php’); /** * After t f’s comment about putting global before the variable. * Not necessary (http://php.net/manual/en/language.variables.scope.php) */ global $name = $_POST[‘name’]; global $email = $_POST[’email’]; … Read more