We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

tylerhall on 07/17/06


Tagged

email textmate emma signup


Versions (?)


Who likes this?

2 people have marked this snippet as a favorite

irdial
mmccrack


Emma Email Signup Code


Published in: PHP 


URL: http://myemma.com/

Processes an Emma email signup form.

  1. function emma_signup($email_address, $first_name="", $last_name="", $group_id)
  2. {
  3. if(!$group_id) $group_id = ;
  4.  
  5. $signup_post = ;
  6. $emma_id = ;
  7. $username = ;
  8. $password = ;
  9.  
  10. $post = "signup_post=$signup_post&emma_account_id=$emma_id&username=$username&password=$password";
  11. $post .= "&group[".$group_id."]=1";
  12. $post .= "&emma_member_email=".urlencode($email_address);
  13. $post .= "&emma_member_name_first=".urlencode($first_name);
  14. $post .= "&emma_member_name_last=".urlencode($last_name);
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_URL,"https://app.e2ma.net/app/view:RemoteSignup");
  17. curl_setopt($ch, CURLOPT_POST, 1);
  18. curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  21. $response_code = curl_exec ($ch);
  22. curl_close ($ch);
  23. }

Report this snippet 

You need to login to post a comment.