HTA and PHP. A match made in heaven?
Or maybe in hell. Who knows. I'm starting to feel like Dr. Frankenstein in my PHP experimentation. So, in another quest to do something just because I can, consequences be damned, I've taken the failure of the ActivePHP(see earlier this week) experiments and turned it into something that actually works. Fundamentally, the model that PHP, the browser and the web server operate on is passing HTTP messages back and forth. Once you remove the web server and substitute an HTA (HTML Application) for the regular browser page, all that needs to be stubbed in is a replacement for HTTP.
So, I did just that. I whipped up a series of Javascript functions that put the contents of a given form into a text file, call a PHP script on the commandline to process that text file and
then the PHP script sends back a message using another temporary text file. In short, round-trip communication. The current prototype uses calls to "php-cli scriptname.php" as its method for processing forms, but you could easily use Priadoblender-blended scripts instead to do the processing.
What you end up with is a simple way to build "stand-alone"
PHP applications without a web server and using HTML as your widget toolkit and GUI. In addition, the API for processing data is just like it is in a web app: simple name->value pairs. So, someone who is already familiar with building PHP web apps could quickly be up and running using this toolkit. Given the flexibility of this solution, it could become a viable alternative to PHP-GTK (at least for little scripts)
The thing still needs a name and some polish so name suggestions are welcome. I'll be putting it under an open source license on PHPGeek.com when it's done. Contact me if you want to play with a demo.

December 1st, 2005 at 8:57 pm
Hello, I'm very interested in having the ability to compile a php script into a stand alone windows application. As your article says, to contact you for a demo of your neato application. If you could send me a download URL that would be muchly appreciated. Thank You!
January 30th, 2006 at 3:59 am
Hello there, I would like to see the demo.
am waiting for full version with impatience.
many thanks if you send me a link too.
March 6th, 2006 at 1:33 am
Hi there, I was working on a similar project during the weekend, and every time I called the PHP script it opened the script in an editor. I will realy appreciate it if you could send me a URL to download the your demo. Many thanks!!
March 31st, 2006 at 4:34 am
hmm..sounds really nice…can i have a copy of the demo..
-thanx..
April 3rd, 2006 at 4:10 pm
Unfortunately, I lost this code in a hard drive crash.
September 22nd, 2006 at 10:19 am
Hey, I recently found about HTA files, that's excelent for simply GUI. If anyon's interested in reading php script output from hta application see my
php-hta example: http://www.mahtar.net/files/hta-php-test.zip
January 12th, 2007 at 6:49 am
Nice procedure. Got it to work for a previously web-based application. One query though - any quick way to support php sessions? I'm trying to whip something together but just wanted to know if someone had already done it.
January 12th, 2007 at 1:11 pm
I don't know of any reasonable way to automatically handle sessions. The Apache module version of PHP does a lot of work to just "magically" handle the sessions and that stuff isn't present in the CLI environment.
May 13th, 2007 at 1:55 pm
Hello
I have checked out the script where you guys have php working along side HTA's.
But instead by creating a text file and make it read it through PHP would not be simpler to use the StdOut property of the Wscript.Exec ?
I guess is trickier tough…
June 29th, 2007 at 2:12 am
Hi there !!
The link to the file "hta-php-test.zip" above is broken … could you please repair it because i would like to have a look at it ??? thanks a lot and congratulations for your site !! bye
September 17th, 2007 at 2:11 pm
I just discovered HTA (html applications). Currently looking into various ways to try and keep the hta files as open as possible (ie use of javaScript, php, etc instead of vbScript and other non-crossPlatform technologies).
I'm really surprised that HTA isn't better known. It makes a great intro to programming via html, javaScript, client-side db connections, etc.. I'm looking for some OpenSource technology that's similar for Linux/*BSD - including Windows (essentially non-secure Kiosks - like any regular application with some additional presentation hooks to make the final product appear as a client-app).
fyi… here's a downloadable demo I found using PHP on the back to process [FORM] info for anyone else interested in html as normal apps.
http://www.phpgeek.com/pragmacms/index.php?layout=main&cslot_1=15