I can send sms using the following form
<form action="http://myserviceprovider/myname/server.php" method="post">
<input type="hidden" value="MyUsername" name="user" />
<input type="hidden" value="MyPassword" name="pass" />
<input type="hidden" value="MyKey" name="sid" />
<input type="hidden" value="12345678" name="sms[0][0]" />
<input type="hidden" value="MyFrist SMS Text" name="sms[0][1]" />
<input type="hidden" value="97654321" name="sms[1][0]" />
<input type="hidden" value="MySecond SMS Text" name="sms[1][1]" />
<input type="submit" />
</form>
Now I am trying to send sms using PHP cURL. I have created an array which contains cellphone numbers and messages:
$sms =array(
array("0" => "12345678", "1" => "MyFrist SMS Text"),
array("0" => "97654321", "1" => "MySecond SMS Text")
);
The problem is I cannot figure out how exactly to send the values including username,password and Mykey using the following
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
curl_exec($ch);
Could you please tell how to solve this problem?