Need help with an API call
Posted: Wed Sep 23, 2009 1:52 pm
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:
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.
- 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 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.