I started with yii2. I want to send an SMS message with yii2. Can anyone help?
I wrote this code in php and it works perfectly
<form id="form1" name="form1" method="post" action="">
<input name="to_number" type="text" id="to_number" />
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
<?php
if ( isset($_POST[‘submit’]) ){
$rand=rand(1000,9999);
$to_number = array($_POST["to_number"]);
$message = array($rand);
$client = new SoapClient("parsasms.com/webservice/v2.asmx?WSDL");
$params = array(
'username' => 'demo',
'password' => 'demo',
'senderNumbers' => array("30005006002651"),
'recipientNumbers'=> $to_number,
'messageBodies' => $message
);
$results = $client->SendSMS( $params );
echo $rand;
}
?>
PLZ anybody can help…