How does it work? Edit
In the server settings you have an option to tell if hkml files being interpre
$_FILES (not fully working atm - therefore disabled in 0.1.3)
$_SERVER variables which have some vital information like referrer etc.
the server accepts POST and GET requests. File transfers will be possible, but are disabled for now (the server crashes, thats why) if u ever done something in PHP, you will find, that requests posted (as well as set via get) are stored globally in $_GET[Varname] Variables Same with $_POST[Varname]
On my list of things to do with Server Variables:
- header injection - so the servers' header content can be changed from within a script,
- superglobals - variables, that will be accessible from different code segments on _ONE_ hkml file.
Template Style Edit
Right now, doing some code like:
<html> <head> <title>HKML TestFile</title> </head> <body> <?ahk a := 5 ?> <p>Some HTML content</p> <?ahk echo(a) ?> </body></html>
will simply not work - technically these are two scripts and run in seperate adress spaces. i need to resetup my IPC so server works as a variable buffer for scripts. along with that, cookie-session management and header injection will become possible.
Other languages Edit
php or asp like vbs wont work, unless someone writes a wrapper for that.
GUI elements Edit
i have setup a technical demo, which is also seen from the screenshot above, showing environment variables in a hkml file which were accessed at runtime of the script - not at that from server. besides each script may do whatever AHK script can do. control applications, create GUIS (no these are not send back to client, 'd be cool though ), whatever ... all GUI actions will physically happen on the server. the client only receives the html (content whatever) you sent back to it.
William: Could an hkml file have a script that takes a screenshot of a gui, and place an image in the public directory of the webserver, and display that image in a <img src="">? If so, then a tedious solution might be to chop a gui up into an image map, and assign buttons to links...
DerRaphael: Theoretically this might work. OTH It is not very practicable due to the nature of how webservices work in general. When a html file is requested, the server runs a script only once and when this exits the result is being returned. so when controlling an external program over web, each time the script need to run the entire procedure again (find the gui, screenshot and send). It might be a better solution to stream the content of the target window and use hkml to modify controls.
GDI (Serverside Graphics) Edit
it is not working atm, but i have plans to include a demo showing how to use GDI+ libraries to dynamically create graphics on the fly and send these back to client.
there is a basic interface for a plugin structure but this needs more improvement, so plugins may be loaded at runtime (enabled or disabled)
Have a look at the Hello World Example