post url newbie
Posted: Tue Mar 16, 2010 6:52 am
I'm trying to convert the code below to Rev:
~~~~~~~~~~~
OleObject ie
integer li_rc
string s, msg, q
q = "select * from status"
ie = CREATE OleObject
li_rc = ie.ConnectToNewObject( "Microsoft.XMLHTTP" )
ie.open( "POST", "http://test/query_test.php", False )
ie.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded")
s = URLEncode( q )
TRY
ie.send( "query=" + s)
CATCH (RuntimeError ErrPrint)
MessageBox("ERROR",ErrPrint.GetMessage() )
END TRY
If ie.readyState <> 4 then
msg = "Failed"
else
msg = string(ie.responseText)
end if
MessageBox("HTTP Response", msg)
destroy ie
~~~~~~
but the example in the dictionary is incomplete:
post myData to URL "http://www.example.net/indications.cgi"
post field "Return Values" to URL field "Current Page"
I need to pass the query string to php page "query=" + s. Please help.
~~~~~~~~~~~
OleObject ie
integer li_rc
string s, msg, q
q = "select * from status"
ie = CREATE OleObject
li_rc = ie.ConnectToNewObject( "Microsoft.XMLHTTP" )
ie.open( "POST", "http://test/query_test.php", False )
ie.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded")
s = URLEncode( q )
TRY
ie.send( "query=" + s)
CATCH (RuntimeError ErrPrint)
MessageBox("ERROR",ErrPrint.GetMessage() )
END TRY
If ie.readyState <> 4 then
msg = "Failed"
else
msg = string(ie.responseText)
end if
MessageBox("HTTP Response", msg)
destroy ie
~~~~~~
but the example in the dictionary is incomplete:
post myData to URL "http://www.example.net/indications.cgi"
post field "Return Values" to URL field "Current Page"
I need to pass the query string to php page "query=" + s. Please help.