I have a custom form in my site that has name and email address field. How can I get the value of this 2 fields to be added on campaign monitor subscriber list when the user successfully submits the form?
This is my form action:
<?php
define('WP_USE_THEMES', false);
require('/opt/www/wp-load.php');
$articletitle = $_POST['articletitle'];
$articlename = $_POST['articlename'];
$articleemail = $_POST['articleemail'];
$articletext = $_POST['articletext'];
$org_post = array(
'post_title' => $articletitle,
'post_content' => $articletext,
'post_status' => 'pending',
'post_type' => 'post',
'post_author' => 6
);
$new_id = wp_insert_post( $org_post );
update_post_meta($new_id, 'contact_name', $articlename);
update_post_meta($new_id, 'contact_email', $articleemail);
header("Location: /success/");
die();
?>