Skip to content

Instantly share code, notes, and snippets.

@stefbowerman
Last active January 4, 2016 20:29
Show Gist options
  • Save stefbowerman/8674295 to your computer and use it in GitHub Desktop.
Save stefbowerman/8674295 to your computer and use it in GitHub Desktop.
MyPlay Mailing List Subscribe
<?php
$url = "https://subs.myplay.com/app/ly/signup";
$fields = array(
'email' => urlencode('user@email.com'),
'country' => urlencode('US'),
'list' => urlencode('ln_musicbox_newsletter'),
'lists_on_form' => urlencode('ln_musicvox_newsletter'),
'confirm' => urlencode('Y'),
);
foreach($fields as $key=>$value) { $fields_encoded .= $key.'='.$value.'&'; }
rtrim($fields_encoded, '&');
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_POST, true);
curl_setopt ($curl, CURLOPT_POSTFIELDS, $fields_encoded);
$result = curl_exec ($curl);
curl_close ($curl);
print $result;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment