Page 1 of 1

Need help with an API call

Posted: Wed Sep 23, 2009 1:52 pm
by suavebum
My company is trying to create on demand emails through MyEmma (A newsletter site) using an API call. They have provided me with this sample code:
  • PHP w/ PEAR's HTTP_Client package
    require_once("HTTP/Client.php");
    $emma_client = new HTTP_Client();
    $emma_client->setMaxRedirects(20);

    // POST should be filtered appropriately
    $_POST['emma_account_id'] = '2975';
    $_POST['signup_post'] = '24863';
    $_POST['username'] = '**username**';
    $_POST['password'] = '**password**';
    $_POST['group'][5376249] = 1;
    $_POST['emma_member_name_first'] = 'Bob';
    $_POST['emma_member_email'] = 'bob@smith.com';

    $emma_client->post("https://app.e2ma.net/app/view:RemoteSignup", $_POST);
    $response_code = $emma_client->currentResponse();
I have never used PHP before and we are trying to keep this in house instead of using our contractors. Unfortunately, no one in house knows PHP and so this project has fallen on me and I am at a loss of where to start. :(

I first just want to create a simple html file with 2 text boxes for member first name and member email just to test it. Would the best way be to put this code into the html file? Or to call a PHP file through the html file?

Any suggestions on how to get this working, or where to find more information would be greatly appreciated.

Thank you.

Re: Need help with an API call

Posted: Wed Sep 23, 2009 1:54 pm
by John Cartwright
Duplicate.. Hrmm... Locked.

Also, [list][/list] tags arn't meant for posting PHP code, instead please use [syntax=php][/syntax]