In this article, we will discuss how to use ManageMore eConnect with your own custom web application. This article assumes that you have implemented the eConnect Service on your computer/network where you are running the program. For more information on this, see the Learning Center Article, “Installing ManageMore Services

 

Communication Class

For programming convenience, we have created a PHP class which can be used to communicate with a running eConnect Server. To download the code for this class, use this link: http://www.managemore.org/library/eConnect/mm-econnect-comm.zip

 

Sample PHP Code

// Inlcude the econnect communication class
include_once( ‘mm-econnect-comm.php’ );

 

// Instantiate Class
$econnect_comm = new econnect_communication();

 

// Set Connection Properties
$econnect_comm->ip_address=’192.168.1.1′;
$econnect_comm->port=443;
$econnect_comm->packet_password=’my_password’;
$econnect_comm->ssl=false;

// Set Packet Info
$econnect_comm->packet_type=’1001′;
$econnect_comm->request_array=array(
‘LID’=>’12345’,
‘LTP’=>’1’,
‘PW’ =>’abc123!’,
);
// Send Packet and Get Response
$econnect_comm->send_packet();

 

// Evaluate Response
if ($econnect_comm->error_status == true) {
$error_message = $econnect_comm->error_message;
}
else {
// Return values are in the response_array
$customer_name = $econnect_comm->response_array[‘CUST’];
}

 

// Note: To send a test packet, you do not need to set any values for packet_type or request_array, packet 9999 is assumed.
// The class will automatically add a WID (web id) if not provided, and Date and Time, Browser User Agent (BUA) and Remote IP (RIP)