Last active
January 4, 2016 20:29
-
-
Save stefbowerman/8674295 to your computer and use it in GitHub Desktop.
MyPlay Mailing List Subscribe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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