Hi all,
As always thanks in advance. My php skills are still at a beginner level but I'm trying to get there!
What I'm trying to do:
Send data to the Mailchimp api (specifically email, name, birthday)
What it currently does do:
Sends and stores email and name
What I cant get it to do:
Send and store the birthday from $birthday string.
First I load the form data:
//Load form data
$day = $_POST['Day'];
$month = $_POST['Month'];
$year = $_POST['Year'];
//Create Birthday in mm/dd format for mailchimp
$birthday = $month."/".$day;
Then I pass it later on to mailchimp:
$mergeVars = array('FNAME' => $parsedName['first'], 'LNAME' => $parsedName['last'], 'BDAY'=>"$birthday");
EVERYTHING in my script works perfectly except for the birthday bit.
So I tried this instead which DOES work, but doesn't use the form data defeating the whole point!
$mergeVars = array('FNAME' => $parsedName['first'], 'LNAME' => $parsedName['last'], 'BDAY'=>"04/04");
I thought it may be the $birthday string wasn't in the mm/dd setup. But after echo'ing it everything is fine.
I get the feeling I'm doing something stupid here. And I think it's syntax based around the ''BDAY'=>"$birthday" part.
Any help will be greatly appreciated! This is driving me INSANE.
Thanks,