This shows you the differences between two versions of the page.
chiamata_asp [2020/08/01 23:02] |
chiamata_asp [2023/12/29 14:29] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Chiamata ASP ====== | ||
+ | ==== Esempio API ==== | ||
+ | < | ||
+ | <% | ||
+ | |||
+ | function SendSMS(username, | ||
+ | url = " | ||
+ | |||
+ | parameters =" | ||
+ | & " | ||
+ | & " | ||
+ | & " | ||
+ | |||
+ | |||
+ | |||
+ | if sender_number <> "" | ||
+ | if sender_string <> "" | ||
+ | |||
+ | select case charset | ||
+ | case " | ||
+ | parameters = parameters & "& | ||
+ | case else | ||
+ | end select | ||
+ | |||
+ | set xmlhttp = CreateObject(" | ||
+ | xmlhttp.open " | ||
+ | xmlhttp.setRequestHeader " | ||
+ | xmlhttp.setRequestHeader " | ||
+ | xmlhttp.Send parameters | ||
+ | |||
+ | If xmlhttp.Status >= 400 And xmlhttp.Status <= 599 Then | ||
+ | SendSMS = " | ||
+ | exit function | ||
+ | End If | ||
+ | |||
+ | msg = xmlhttp.responseText | ||
+ | set xmlhttp = nothing | ||
+ | |||
+ | SendSMS = msg | ||
+ | end function | ||
+ | |||
+ | Dim recipients | ||
+ | Dim i | ||
+ | |||
+ | ' Invio di un singolo SMS | ||
+ | recipients = array(" | ||
+ | |||
+ | ' Per invio multiplo del testo a 2 o più destinatari | ||
+ | ' recipients = array(" | ||
+ | |||
+ | |||
+ | |||
+ | ' Invio SMS | ||
+ | result = SendSMS(" | ||
+ | |||
+ | responses = split(result,"&" | ||
+ | |||
+ | for each item in responses | ||
+ | Response.write item & "< | ||
+ | next | ||
+ | |||
+ | %> | ||
+ | </ |