Local loDate Local lcReport loDate = Createobject("empty") AddProperty(loDate, "to", "0723197939") AddProperty(loDate, "message", "test " + Ttoc(Datetime())) AddProperty(loDate, "footer", "@MMM") lcReport = sendsms(loDate) Messagebox(m.lcReport) XMLTOCURSOR() ************************************** * plugin_sms_playsms * Apeleaza api playsms Trimite catre playsms * http://192.168.75.101/html/playsms */index.php?app=ws&u=admin&h=eabd6195724d56d08a5a2ca0573451b6&op=pv&to=0723197939&msg=test+only ************************************** Procedure sendsms Lparameters toDate * toDate: .to, .message, .footer #Define HTTPSTATUS_OK 200 #Define HTTPSTATUS_CREATED 201 #Define HTTPSTATUS_ACCEPTED 202 #Define HTTPSTATUS_MULTISTATUS 207 #Define HTTPSTATUS_BADREQUEST 400 #Define HTTPSTATUS_UNAUTHORIZED 401 #Define HTTPSTATUS_FORBIDDEN 403 #Define HTTPSTATUS_NOTFOUND 404 #Define HTTPSTATUS_INTERNALSERVERERROR 500 Local loHTTP As "Microsoft.XMLHTTP" Local lcBaseURL, lcFooter, lcMessage, lcPluginPath, lcResponse, lcTo, lcToken, lcURL, lcUser Local lcUtilsPath, lcwwhttp, lnStatus lcPluginPath = Addbs(Justpath(Sys(16, 0))) lcUtilsPath = m.lcPluginPath + 'utils\' *!* Set Path To (m.lcUtilsPath) Additive *!* lcwwhttp = m.lcUtilsPath + 'wwhttp.prg' *!* Do (m.lcwwhttp) lcBaseURL = [http://192.168.75.101/html/playsms] lcUser = [admin] lcToken = [eabd6195724d56d08a5a2ca0573451b6] lcTo = toDate.To lcMessage = urlencode(toDate.Message) lcFooter = urlencode(toDate.Footer) lcURL = m.lcBaseURL + [/index.php?app=ws&u=] + m.lcUser + [&h=] + m.lcToken + [&op=pv&to=] + m.lcTo + [&msg=] + m.lcMessage + [&format=xml] + Iif(!Empty(m.lcFooter), [&footer=] + m.lcFooter, []) loHTTP = Createobject("Microsoft.XMLHTTP") loHTTP.Open("GET", m.lcURL, .F.) loHTTP.Send() lnStatus = loHTTP.Status If m.lnStatus = HTTPSTATUS_OK lcResponse = loHTTP.responseText Return lcResponse Endif Endproc && sendsms Function urlencode * * from http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/27/pid/184/qid/597112 * also http://fox.wikis.com/wc.dll?Wiki~VFPPortListener~VFP * I'm confused by this code. * I believe it doesn't translate spaces correctly * * a proper definition is in: http://www.ietf.org/rfc/rfc2396.txt * starting about half way down page 5 * unreserved characters include all alphas, all digits and the following unreserved marks * mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")" * Lparameter pcinstr * ' encode Percent signs * ' Double Quotes * ' CarriageReturn / LineFeeds Local lcout, lni lcout = '' For lni = 1 To Len(pcinstr) lcch = Substr(pcinstr, lni, 1) Do Case Case Isalpha(lcch) Or Isdigit(lcch) Or Inlist(lcch, "-", "_", ".", "!", "~", "*", "'", "(", ")") * do nothing Case lcch = " " lcch = "+" Otherwise lcch = '%' + Right( Transform(Asc(lcch), '@0'), 2 ) Endcase lcout = lcout + lcch Endfor Return lcout Endfunc && UrlEncode