(added September 22, 2007)
Now, you can make your own web pages and web applications with AutoIt! And, with AuCGI, easier and better than ever before!
AuCGI allows for exciting new features such as <?au3 ?> tags!
Here's all you have to do to start making your own web pages in AutoIt!
1.) Download AuCGI.exe (click) and put it in C:\ (or wherever you want)
2.) Download Web.au3 (click) and put it in C:\Program Files\AutoIt3\include, or if you are using beta, C:\Program Files\AutoIt3\beta\include
ABYSS WEB SERVER
3.) Download and install Abyss Web Server X1 if you haven't already from http://www.aprelium.com/
4.) go to the Abyss Control panel (usually http://192.168.0.1:9999/ )
5.) Click Configure next to the Default Host (or if you have ...bought... Abyss Web Server X2, next to whatever host you want to configure)
6.) Go to Scripting Parameters
7.) If you have already installed Web-Based AutoIt, click the pencil next to the AutoIt interpreter. If you are new to web-based autoit, click the Add button in the Interpreters table.
8.) Fill in the info with this...info:
(or where ever you put AuCGI.exe in step 1)
Arguments: LEAVE BLANK
If you are new to web-based autoit (didn't have it installed before), click Add under Extensions, and type auw (or ahp or whatever file extension you want to use for web-based Apps)
9.) click OK
10.) click OK again
11.) Click Restart at the top of the page
12.) you're ready!
NOTE: AUCGI WITH APACHE IS UNTESTED AND MAY NOT WORK. IF YOU USE APACHE, PLEASE TEST THIS AND TELL ME HOW IT WORKS OUT.
3.) Add the following text to either your apache config file, or your .htaccess file (or create a .htaccess file and put this in there)
Options +ExecCGI AddHandler cgi-script .auw
If you want, replace .auw with .ahp or whatever file extension you want to use for web-based Apps.
4.) I think that's it. Now, whenever you want to make a web-based App, put this at the beginning:
if you put AuCGI.exe somewhere other than C:\, put the path to there after the #!
This is called a Shebang line.
Yes, this has to go at the VERY beginning of the web-based app. it has to be on the very first line. No blank lines or spaces or tabs or anything before it. Even before the ##WebApp line (which you'll learn about later...)
To make your first web-based app!
On the first line needs to be this:
This marks your scripts as a web-based app. Without that there, your script will not work.
If you wish, you can add parameters after that. For example:
##WebApp title="My Cool Web Page"
if you specify a title, the starting html tags are there for you. If you want to put other info in the <head> tag or anything, you should set the title manually using the <title> tag, instead of using the ##WebApp line.
As with the Shebang line, this must go at the very top of the script, with no blank lines or spaces before it. However, if you are using Apache, this should go after the Shebang line.
you can also use
to change the content type that is sent to the server. The default is text/html. You could also use text/plain or pretty much any standard format content type.
or you can use both:
##WebApp title="My Title" content-type="blah/blah"
But I don't see why you would do that, seeing as changing the content type will make the title not work anyway...
Note: Don't put double quotes in your title. Double quotes should be used to surround the title, but they should not be inside the title. Also, don't even try using variables. It won't work.
Here is an example of what NOT TO DO:
##WebApp title="My name is " & $name & "! How are you?"
I'm not sure why you would need a title like that anyway, but it won't work. it will just cut off at My name is.
Next, you can use html or text or whatever you want. Or, you can start using AutoIt. everything between <?au3 and ?> is considered AutoIt, and anything outside it is considered html (or plain text or whatever if you changed the content typo)
You can use whatever autoit you want inside the <?au3 ?> tags, and whatever html you want outside them. Note that I will eventually release a version of AuCGI that lets you block certain commands.
Note: For people who have used Web-based AutoIt before, you no longer need to use _StartWebApp. That is done for you automatically when you use the #WebApp line.
Note: You do not need to include Web.au3. this is done for you AUTOMATICALLY. You can use any functions in Web.au3, but you do not need to include it. I guess you can if you really want, but it won't make any difference...
That's about it. If you have not used web-based autoit before, sorry, I don't have the instructions on how to use all the functions. I will type up a formal help file soon.
If you have used web-based autoit before, it's exactly the same functions as before. Just use autoit inside <?au3 ?> tags and html outside. HOWEVER, _Post doesn't work. I don't think. So, don't even try. Or you can try and see if you can get it to work, but I couldn't.
If you want it, here is the source to AuCGI.exe (click).
Edited by theguy0000, 15 July 2008 - 04:42 AM.