Suljettu

Mailchimp API Add Subscriber php form post

I need that next code works into file.php.

If I use absolute values (not variables), it works correctly. But I can't get the email and name variables from the form.

$email = 'EMAIL_ADDRESS';

$list_id = 'xxxxxx';

$api_key = 'xxxxxxxxxxxxxxx';

$data_center = substr($api_key,strpos($api_key,'-')+1);

$url = 'https://'. $data_center .'.[login to view URL]'. $list_id .'/members';

$json = json_encode([

'email_address' => $email,

'status' => 'subscribed', //pass 'subscribed' or 'pending'

'merge_fields' => [

'FNAME' => 'ENTER_FIRST_NAME'

]

]);

try {

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_USERPWD, 'user:' . $api_key);

curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_TIMEOUT, 10);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

curl_setopt($ch, CURLOPT_POSTFIELDS, $json);

$result = curl_exec($ch);

$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

if (200 == $status_code) {

echo "The user added successfully to the MailChimp.";

}

} catch(Exception $e) {

echo $e->getMessage();

}

?>

Taidot: PHP, Tietojärjestelmäarkkitehtuuri, MySQL, JavaScript, JSON

Näytä lisää: php form post webpage, php form post aspnet, add numbers php form, php form post ssl, php form post display, php html form post csv file, php form post spam, add flash php form fields, php form post text file, mailchimp api add subscriber group asp, campaign monitor api add subscriber php, mailchimp api add subscriber to list, mailchimp php api add subscriber, aweber api add subscriber php, mailchimp api add subscriber to list php, mailchimp api add subscriber, mailchimp api add subscriber javascript, mailchimp api add subscriber to group, mailchimp api add tag to subscriber

Tietoa työnantajasta:
( 6 arvostelua ) Chillán, Chile

Projektin tunnus: #29869859

7 freelanceria on tarjonnut keskimäärin $34 tähän työhön

microwebtechs

HI THERE, PLEASE SHARE WEBSITE DETAILS AND MAILCHIMP ACCOUNT DETAILS, I WILL INTEGRATE MAILCHIMP ACCOUNT IN PHP WEBSITE SOON. PLEASE REPLY NOW AND HIRE ME FOR START WORK RIGHT NOW. I AM WAITING FOR YOUR RESPONSE. THANK Lisää

$100 USD 1 päivässä
(347 arvostelua)
7.1
justTry

Hi! There are two immediately identifiable issuse with that code addition. One is that you should really be running that mailchimp submission only when the form is actually ubmitted and not on page load as well, whi Lisää

$20 USD 1 päivässä
(182 arvostelua)
6.2
Alkobazik

Ready to help. Have great experience in PHP and API integration. Please contact via chat, so i can start right now

$25 USD 2 päivässä
(27 arvostelua)
5.1
XPedDev

Hey there, let's give out what goes wrong and fix it. After that I'll explain what was wrong, why it didn't work and what the fix was

$15 USD 1 päivässä
(10 arvostelua)
3.1
romandanchenkode

Hi, I understood what you want. I can do it right now perfectly. Please contact me. Let's start work immediately. Thanks.

$30 USD 1 päivässä
(0 arvostelua)
0.0
cesarcampos11

Hola, tengo varios años trabajando con audiencias Mailchimp, de hecho tengo varios programas insertando contactos en Producción. Asígname la tarea y será un gusto ver [login to view URL] funcionando satisfactoriamente, Saludos.

$20 USD 1 päivässä
(3 arvostelua)
0.0
skyeslar

API INTEGRATION PRO DEV Crafting Uniqueness for Digital Presence with the highest ROI Don’t let your website be just another URL on the web. I am here to convert it into a powerful marketing medium and attract prospe Lisää

$30 USD 1 päivässä
(0 arvostelua)
0.0