I have created a custom form using shortcode widget for my page sidebar, but the form input wasn't saving to may wordpress database. Can anyone help me with this. Please see below my codes.
<?php
if ( isset( $_POST['submit'] ) ){
global $wpdb;
$lplifeinsurance_leads=$wpdb->prefix.'lplifeinsurance';
$data=array(
'quotes' => $_POST['quotes'],
'cover' => $_POST['cover'],
'health' => $_POST['health'],
'provider' => $_POST['provider'],
'birthdate' => $_POST['birthdate'],
'gender' => $_POST['gender'],
'lname' => $_POST['lname'],
'address' => $_POST['address'],
'number' => $_POST['number'],
'email' => $_POST['email'] );
$wpdb->insert( $lplifeinsurance_leads, $data);
}
?>