1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| function envoyesms($numero,$username,$mdp)
{
$ovh_url = 'https://www.ovh.com/cgi-bin/sms/http2sms.cgi?';
$secur_ovh_account ='XXX';
$secur_ovh_login ='XXX';
$secur_ovh_pass ='XXX';
$ovh_from ='XXX';
$ovh_nostop='1';
$ovh_contenttype ='text/xml';
//Construction du message
$message="Voici%20vos%20identifiant,%20login:%20$username,%20mot%20de%20passe:%20$mdp";
//Creation du numero pour les francais
if(preg_match('/^0[6-7][0-9]{8}$/',$numero)) {
$index_international = "00336";
$num = substr($numero,2);
$num = "$index_international$num";
}
//POur les numeros international
//Pour les numeros international
else
{
$num = $numero;
}
//Envoye du sms
$response = http_get("https://www.ovh.com/cgi-bin/sms/http2sms.cgi?smsAccount=$secur_ovh_account&&login=$secur_ovh_login&password=$secur_ovh_pass&from=$ovh_from&to=$num&contentType=text/xml&message=$message&noStop=$ovh_nostop");
echo $response;
}
// fermeture de la balise php
?> |
Partager