Php language to Mq4

 

Hi I would like to ask some help how to convert the php code into mql4? 

/*** Mandatory data ***/
// Post URL
$postURL = "";
// The Secret key
$secretKey = "5e57afc37cfee8.49286108";

/*** Optional Data ***/
$firstname = "John";
$lastname = "Doe";
$email = "john.doe@gmail.com";

// prepare the data
$data = array ();
$data['secret_key'] = $secretKey;
$data['slm_action'] = 'slm_create_new';
$data['first_name'] = $firstname;
$data['last_name'] = $lastname;
$data['email'] = $email;

// send data to post URL
$ch = curl_init ($postURL);
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$returnValue = curl_exec ($ch);

// Process the return values
//var_dump($returnValue);
 
Jiao Hong:

Hi I would like to ask some help how to convert the php code into mql4? 

That code translates into use of MQL4's WebRequest: https://docs.mql4.com/common/webrequest

Among the irritating problems you will have to deal with is that curl will do post-encoding of values for you, whereas in MQL4 you will need to write your own code - or find some on the forum - not only to build the POSTed data but also to correctly post-encode the values.