HTTPRequest
Posted: Wed Jul 15, 2015 12:44 pm
In PureBasic I use the WinApi function
to send the values of the two parameters name and age to the php-script mydatabase.php, which has the function to open a mysql database and save the transmitted data. A possible answer of the php-script via exit() - e.g. exit("transaction war successful"); - is stored in the text file result.txt then.
(one can also use the PB command ReceiveHTTPFile() or the comfortable callback solution by - I think - Hexor)
I tried this within SpiderBasic by using the HTTPRequest-function:
But only the error message is displayed. My question is, whether I'm on the right way by using HttpGetEvent().
Code: Select all
URLDownloadToFile_(#Null, "http://mydomain/mydatabase.php?name=Angelo&age=37", "result.txt", #Null, #Null)
(one can also use the PB command ReceiveHTTPFile() or the comfortable callback solution by - I think - Hexor)
I tried this within SpiderBasic by using the HTTPRequest-function:
Code: Select all
Procedure HttpGetEvent(Success, Result$, UserData)
If Success
Debug Result$
Else
Debug "HTTPRequest(): Error"
EndIf
EndProcedure
HTTPRequest(#PB_HTTP_Get, "http://mydomain/mydatabase.php?name=Angelo&age=37", "", @HttpGetEvent())