I have this drupal site, there is a candidate registration page where anyone can fill the details (name, gender, address, mobile no etc) and submits and a success node page is displayed with all details applicant fills, then at admin side applications will be used for further offline processing. Everything is working fine.
What i am trying to do now is, after filling the details - like mobile number and other details applicant will click on submit button and all will be saved to database as usual but an sms will be sent to that mobile number.
I have my php sms script ready, but can't really add / embed it on form submission where i guess it will catch the mobile number and my php sms script will be run.
<?php
$mobile = '10 digit mobile number';
$entityID = 'xxxxxxxxxxxxxxx';
$uname = "xxxxx";
$pass = "xxxxxxxxx";
$senderID = 'xxxxxxx';
$destination = urldecode($mobile);
$smsContent = urlencode(addslashes($smsbody));
$URL = "https://smsgateway.in/link?username=$uname&pin=$pass&message=$smsContent&mnumber=$destination&signature=$senderID&dlt_entity_id=$entityID&dlt_template_id=$tmpltID";
if ($destination != 0) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, '/ca-bundle.crt');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (stristr($response, "info=Platform accepted")) {
// $messageArray[] = $mob;
}
curl_close($ch);
}
?>