interact with a php script

BlitzMax Forums/BlitzMax Programming/interact with a php script

slenkar(Posted 2007) [#1]
I used blitz3d to interact with a PHP script, to host my own GNET server.
Has anyone done this with blitzmax?


FlameDuck(Posted 2007) [#2]
Kinda. Not for GNET, or with PHP tho'. But for online storage/updates and with J2EE.

The principles are roughly the same tho'.


slenkar(Posted 2007) [#3]
I just need to retrieve some basic info like how many people are playing a game online


Perturbatio(Posted 2007) [#4]
This might help:


And I can recommend JSON for small amounts of data transfer:
http://www.blitzbasic.com/codearcs/codearcs.php?code=2066#comments


slenkar(Posted 2007) [#5]
thanks, how I do send commands to the PHP script, (that interacts with a database)


Perturbatio(Posted 2007) [#6]
you would either send them via GET (passed via the URL as per the above example) or find a way to send POST headers (much more complicated but more flexible).


Beaker(Posted 2007) [#7]
Etna might help:
http://repeatuntil.online.fr/Etna/


slenkar(Posted 2007) [#8]
is it something like

www.mywebsite.com/gnet.php?get

to send a command?


FlameDuck(Posted 2007) [#9]
It depends on what you mean by "command". Generally an url encoded parameter list looks something like this: www.mywebsite.com/gnet.php?parameter1=value1&parameter2=value2&parameter3=value3 etc...

I haven't looked at the gnet PHP script so can't be of much help there, sorry.


slenkar(Posted 2007) [#10]
I have the source code for blitz3d Gnet,
now I know how to pass values hopefully I can work it out


RepeatUntil(Posted 2007) [#11]
ETNA was specifically designed for this: interaction with a php script which then interact with a mysql database. Advantage of ETNA: it uses threads, so the request do not slow down (or stop in fact) the program. Get it from my sig (it's free)...


slenkar(Posted 2007) [#12]
thanks that does solve the slowdown problem.
any plans for a mac version?


RepeatUntil(Posted 2007) [#13]
Unfortunately (I am the first disappointed), this is not possible to have ETNA for Mac or Linux, because it is developped in PureBasic and uses dll.
ETNA will be multiplateform when Blitzmax will be multithreaded ;-) (which is not for tomorrow I believe)


Dreamora(Posted 2007) [#14]
Or if the creator of PB gets around implementing .SO and DynLib compile to be true multiplatform ;-)