开发者

POSTing a CSV from FoxPro to an url

I'm looking for a concrete exam开发者_StackOverflowple of how FoxPro can generate a CSV or XML chunk and POST it to an URL?

( this is so my URL -> PHP script can then parse and update MySQL )


USE MyData
COPY TO MyData.csv TYPE delimited
USE
LOCAL lcMyData
lcMyData = FILETOSTR("MyData.csv")

LOCAL xhr
xhr = CREATEOBJECT("Microsoft.XMLHTTP")
xhr.Open("POST", "http://www.mydomain.com/posthandler.asp", .f.)
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
xhr.send("data=" + lcMyData)

LOCAL lcResultText
lcResultText = xhr.responseText;

? lcResultText
xhr = null

This has a dependency on the XMLHTTP object which gets installed with Internet Explorer.


Another great tool to use to get your FoxPro applications online is West Wind Web Connect. It's not free but it's the best tool to get your FoxPro application online.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜