Jump to content

Web-based AutoIt! - New with AuCGI!


theguy0000
 Share

Recommended Posts

<Removed ajax demo, will add another later>

This shows off what can be done using a javascript framework, like MooTools. MooTools is very slick.

I've demoed variables, static text, functions, and macros loaded dynamically on user actions.

I'm still working on a user input demo, that will grab form data, send it to be processed by AuCGI, and then return a result, without reloading the page.

Edited by JRowe
Link to comment
Share on other sites

You'll need to change the .auw extension to whatever you're using, if it's something different. The test.html page is where you should go to see the demo. I've basically just modified the mootools Request.Html demo. Very fun stuff :P

Link to comment
Share on other sites

  • 1 month later...

Hi

i tryed to create a login form but i'm still unable to get the login data by POST.

<?au3 echo(EnvGet("REQUEST_METHOD")&" - "&$_POST_raw&" - "&$PostContentLength) ?>

Returns:

POST - - 39

I'm using the newest version of Web.au3 include.

Note: this piece of code is just a part out of my webpage.

nvm i changed it a bit so it works now. :)

Edited by Dellairion
Link to comment
Share on other sites

Hi,

I'm very interested by web based autoit but, it's almost impossible to download auCGI.exe on theguy0000.com !

so, it's this peace of software still available ? if yes where.

thank's

Look at the first post: LINK

EDIT: hm.. odd... the last time I downloaded it, it was ok

Edited by bluelamp
Link to comment
Share on other sites

TheGuy0000 servers are down, so here is a quick fix for some of you...

AuCGI.txt which is the un-compiled version of AuCGI.exe, can be found on Google's Cache...

AuCGI

http://72.14.205.104/search?q=cache:gZrttU...;cd=1&gl=us

and Web.au3 can be found here...

http://72.14.205.104/search?q=cache:7Lh8PT...;cd=4&gl=us

SIGNATURE_0X800007D NOT FOUND

Link to comment
Share on other sites

I just discovered this, and it's a great idea. I'm already planning out something I want to allow end users to do via a web page. The end user would fill out a form and when they submit, a proprietary program is run on the server and the tasks needed are automatically done for them. We can only run so many instances of this proprietary program, and it's much too powerful for end users to handle, so having a central server automate the tasks is going to be extremely useful.

Please don't be discouraged by it not being included in the official distribution, I think it's an incredibly useful add-on! It's brings "Webmin" to Windows.

There's plenty of need for making a web-based abstraction layer for Windows programs to not only automate tasks in that program, but to pull out information to be displayed... especially for someone using a mobile device that can't run a full Windows program. Put it in the cloud!

Link to comment
Share on other sites

Hi

i tryed to create a login form but i'm still unable to get the login data by POST.

<?au3 echo(EnvGet("REQUEST_METHOD")&" - "&$_POST_raw&" - "&$PostContentLength) ?>

Returns:

POST - - 39

I'm using the newest version of Web.au3 include.

Note: this piece of code is just a part out of my webpage.

nvm i changed it a bit so it works now. :)

I'm curious, what did you change it to? I'm having the same problem getting POST to work.

It could be because I'm using IIS. I've been working with IIS 5.1 for XP and will eventually move it over to Server 2003. The only limitation I know of so far is that you can't interact with the desktop in 5.1 (no server side message boxes, etc, it'll lock up the script). I worked around that by making the AUW a client that sends the data over a socket connection to another computer that I want to remotely control and automate. It works great if I pre-populate the variables (especially if you don't want your web server to be the machine you automate), but until I get POST working it's kinda useless.

Here's what I have so far:

<form name="colourform" ENCTYPE="multipart/form-data" action="http://127.0.0.1/colours.auw" method="POST">
Type your name: <input type="text" size="25" NAME=name value="Type your name here!"><br>
What's your favourite colour?<br>
<input type="radio" NAME="colour" value="RED" checked> Red<br>
<input type="radio" NAME="colour" value="GREEN"> Green<br>
<input type="radio" NAME="colour" value="BLUE"> Blue<br>
<INPUT type="Submit" value="Submit">

<?au3
$name = _Get("name")
echo($name)
$colour = _Get("colour")
echo($colour)
?>

The variables will be completely empty. Any ideas?

Edited by complexjunk
Link to comment
Share on other sites

@Dellairion

Uptill now I don't know of anyone who get it to run on an IIS ?

So if one of you did get it to run, I would be interested to know how.

In the meantime you can look in my signature for how to run it on a "LightTPD" server.

Regards,

ptrex

Link to comment
Share on other sites

@Dellairion

Uptill now I don't know of anyone who get it to run on an IIS ?

So if one of you did get it to run, I would be interested to know how.

In the meantime you can look in my signature for how to run it on a "LightTPD" server.

Regards,

ptrex

It works, but like I said, it's limited with at least XP's IIS 5.1. It might not be the case with IIS6 (Server 2003), which allows you to choose what user you want an application pool to run as. But, when I tried something similar to get the AuCGI process to run as my interactive account's user in XP's IIS, it still wasn't able to interact with the desktop, not sure why. See my previous post on bypassing that limitation. And also, out of the box POST is probably broken with using AuCGI in IIS.

Right click on your website and go to Properties, then under the Home Directory tab click Configuration. Add a mapping for .auw and

C:\pathtoyour\aucgi.exe "%s"

Hi there i'll explain in detail what i changed when i'm at home and that will be tommorow evening.

At the moment i don't have the source with me and the website of theguy0000 isn't working.

I am using IIS also.

I can try to explain anyway.

I just added a variable in the aucgi handler that will be putted together then with the rest of the source of that specific webpage.

Where $var = " ... #include <web.au3> ... "

changed to " ... $POST = "&EnvGet('HTTP_POST')&"@CRLF&#include <web.au3> .. "

(I'm not sure the name HTTP_POST of the env is correct)

This means that the webpage now stores the post on $POST.

Now in web.au3 you need the change the line that contains something like $r_raw_POST = .. if i'm correct.

Change that to $r_raw_POST = $POST.

Thats what i did because i didn't got it work too on iis, i hope u understand it.

Note: "..." just means that there is some code before or after it.

Dellairion

A few posts up BinaryBrother actually posted the code from Google Cache if you need the original unmodified code to compare.

I'm a little confused here, but I'll wait for your full instructions. Thanks for the help!

Link to comment
Share on other sites

Hello,

Sorry for the late reply i lost it out of sight. Thanks complexjunk for reminding me.

This is what i did to get AuCGI to work on IIS 6.0 (should work also on other versions i think).

(If you haven't IIS installed yet on your server you can go

for details here for IIS 6.0 and here for IIS 7.0.)

First of all place your AUCGI somewhere for example 'C:\AuCGI\'.

When u have installed IIS, goto 'Control Panel -> Administrative Tools -> Manage Your Server' if it isn't open yet (a window should open with the name Manage Your Server).

Then click on 'Manage this application server' which can be found under 'Application Server'.

A new window will popup, if you have installed IIS corectly a subdir named 'Internet Information Services (ISS) Manager' will be shown, double click on it, another subdir will be shown click that one open also.

(With other words just goto your IIS configuration panel.)

Step 1:

Now to start right click on '<servername> (local computer)' and then click on 'Properties'.

A new windows will popup. Click on 'MIME Types... -> New...'.

In the field 'Extension' should come the extension u are going to use for AutoIt web files (example: '.ahp', '.aux' and more).

In the field 'MIME type' should be 'text/html' (both without the quotes).

Then click 'OK' 3 times (to close all the child windows).

Step 2:

Now you're back in the 'Application Server' window right click on the subdir 'Web Sites' and then properties.

Goto the tab named 'Home Directory' and click on the button 'Configuration...'.

Under the tab 'Mappings' in the new window that just popped up, click on the button 'Add...'.

In the field 'Executable' should be the path to your AuCGI.exe for example 'C:\AuCGI\AuCGI.exe'.

After the path should "%s" be added so the result should be this:

C:\AuCGI\AuCGI.exe "%s"

In the extension field should be the same extension as used in step 1 ('.ahp', '.aux' or other).

In 'Verbs' the option 'All verbs' should be selected and also 'Script engine' should be selected.

Now click 'OK' until you are back into the 'Web Sites Properties' window.

To add the 'index.<your_extension>' so IIS opens it as standard goto the tab 'Documents'.

Click on the 'Add...' button and fill in 'index.<your_extension>' (example: 'index.ahp' or 'index.aux')

Click 'OK' until are child windows are closed again.

Step 3:

Goto the subdir named 'Web Service Extensions' in the 'Application Server' window.

Click on the button/link named 'Add a new Web service extension...'.

In the field 'Extension name' you can put whatever name you want.

Click on the 'Add...' button at the right from the 'Required files' field.

In the field 'Path to file' should be exact the same as in step 2 (example: C:\AuCGI\AuCGI.exe "%s").

Click 'Ok'.

Now the file is added in 'Required files' click on it and then click on the button 'Allow'.

Click 'OK'.

You now have added the AuCGI Extension to IIS.

I hope you understand this and correct me if i'm wrong or if unclear :P.

Grz,

Dellairion

Edited by Dellairion
Link to comment
Share on other sites

This is my solution to fix the post that isn't working.

Maybe a little bit amateuristic but it works.

First of all:

Open the 'AuCGI.au3'

Look for the line with this code:

$source = " ?><?au3 #include <Web.au3>"&@CRLF&"Global $AuCGI_version = '"&$version&"'"&" ?>"&$source&"<?au3 "oÝ÷ Ø(Z¢¶ÚºÚ"µÍÌÍÜÛÝÙHH    ][ÝÈÉÝÉÏØ]LÈ    ÌÍÔÔÕÑUHH ÌÎNÉ][ÝÉ[ÐÛÛÛÛTXY

I[É][ÝÉÌÎNÉ][ÝÉ[ÐÔ[É][ÝÈÚ[ÛYH    ÕÙX]LÉÝÉ][ÝÉ[ÐÔ[É][ÝÑÛØ[  ÌÍÐ]PÑÒWÝÚ[ÛH   ÌÎNÉ][ÝÉ[ÉÌÍÝÚ[Û[É][ÝÉÌÎNÈÉÝÉ][ÝÉ[ÉÌÍÜÛÝÙI[É][ÝÉÏØ]LÈ    ][ÝoÝ÷ Ú,³
è"¶aȧ*kzúh²Ûh~,,·B¢jbè­6(¥é÷õgjí÷ô(ZºÚ"µÍÛØ[    ÌÍ×ÔÔÕÜ]ÈHÛÛÛÛTXY
    ÌÍÔÜÝÛÛ[[Ý

Now you should be able to get 'post' by '_Post("nameofvartoget")'.

Btw, is it just me or is the having problems with viewing and posting on the forums.

Everything is slow and sometimes the server returns an internal error.

Grz,

Dellairion

Edited by Dellairion
Link to comment
Share on other sites

@Dellairion

Thanks for the nice step by step explanation of the CGI installation on IIS.

But unfortunately most os us use XP Pro which has IIS 5. So you step by step guide does not work on this version.

Any chance on guiding us through on IIS 5 ?

PS: sometime the forum is quite slow indead.

Regards,

ptrex

Link to comment
Share on other sites

Well the problem is that i have never used IIS 5 and i dont have xp but vista installed on my pc.

My IIS is running on a seprate computer with windows server 2003 on it.

Also what i did with IIS 6.0 that runs on my server was pure setting some options and testing because i have never used IIS myself before.

But i'll see what i can do.

Link to comment
Share on other sites

Thank you so much for the fix, Dellairion. I can now pass the values over to a script I was working on. Here is some example code for others in case they need it:

colours.auw

##WebApp title="Colours"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<p>
<?au3
$name = _Post("name")
echo("Your name is: " & $name & ".<br>")
$colour = _Post("colour")
echo("Your favourite colour is: " & $colour & ".")
?>
</p>
</body>
</html>

colourform.html (you need to change the action= to your web server's!)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Colour Form</title>
</head>
<body>
    <form name="colourform" action="http://127.0.0.1/colours.auw" method="POST">
Type your name: <input type="text" size="25" NAME=name value="Bob"><br>
What's your favourite colour?<br>
<input type="radio" NAME="colour" value="RED" checked> Red<br>
<input type="radio" NAME="colour" value="GREEN"> Green<br>
<input type="radio" NAME="colour" value="BLUE"> Blue<br>
<INPUT type="Submit" value="Submit"></body>
</html>

@Dellairion

Thanks for the nice step by step explanation of the CGI installation on IIS.

But unfortunately most os us use XP Pro which has IIS 5. So you step by step guide does not work on this version.

Any chance on guiding us through on IIS 5 ?

PS: sometime the forum is quite slow indead.

Regards,

ptrex

ptrex, this DOES work in IIS 5 for XP (this example code works fine on my installation after the fix Dellarion posted). Look at my earlier post on how to do it, let me know if there's anything I've forgotten. Be sure to restart IIS, and if it doesn't work, tell me what it's doing (or not doing). Edited by complexjunk
Link to comment
Share on other sites

After using IIS with it for a while, I've realized that it's not very reliable. It tends to not complete the script a lot, and give up half way. On one page, it wouldn't get past the header randomly, and just show a blank page. I had to switch to Abyss to do this script, and it works a lot better. At least now I can see any error messages that crop up. I just hate the fact I can't integrate it into my existing setup.

Another problem I'm having is that because of AuCGI's headers, they seem interfere with CSS I need to use in the page. I'm guessing it doesn't like two head tags, but this mainly is a problem with IE7. You can test it out by making a nice looking page with an HTML extension, then converting it to AUW, they look completely different in IE. It's not the end of the world, but I thought I would mention it.

theguy0000 hasn't posted here in a while, I hope he hasn't abandoned the script. I love it, it really opens up a new world to me.

Edited by complexjunk
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...