So I’ve successfully implemented a sign-up form for my list.
One problem I’m still having is with fields validation… whenever I leave an empty field, I get redirected to the MailChimp site - which I want to prevent and do all validation directly on my site.
Is there a way to test, where things go wrong with the php files ?
I’ve got php console chrome extension, but it doesn’t do anything.
Here are all my files.
http://progressive-overload.com/js.js
Subscribe.php
<?php
$api_key = "";
$list_id = "";
require('Mailchimp.php');
$Mailchimp = new Mailchimp( $api_key );
$Mailchimp_Lists = new Mailchimp_Lists( $Mailchimp );
$subscriber = $Mailchimp_Lists->subscribe( $list_id, array( 'email' => htmlentities($_POST['email']) ) );
if ( ! empty( $subscriber['leid'] ) ) {
echo "success";
}
else
{
echo "fail";
}
?>
Mailchimp.php (11.6 KB)