How to call a PHP function on submit button
My function is
function sendSMS($mobile, $msg, $sender, $sendPass, $sendID)
{
$msg=urlencode($msg);
$ch = curl_init();
$url="abusms.com/pushsms.php?username=kas&password=6117&sender=SHRIA&to=$mobile&message=$msg";
//echo $url;
$url=urlencode($url);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1)or die("error1");
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);
echo $data;
echo
curl_close($ch);
return $data;
//return substr($data,0,1);
}
<tr>
<td colspan="3" align="center"><input type="submit" name="send" value="send" onclick="sendSMS($mobile, $msg, $sender, $sendPass, $sendID)"/> </td>
</tr>