Jump to content

Example: How Autoit works with Webserver!


fielmann
 Share

Recommended Posts

hi folks,

Example: How Autoit works with Webserver! :o

1) Install Webserver: http://www.aprelium.com/abyssws/

2) Configure Abyss: Scripting-Parameters = AU3 = C:\Programme\AutoIt3\AutoIt3.exe

3) Create + save file "C:\Programme\Abyss Web Server\htdocs\webbasics.au3"

content of webbasics.au3:

$sContent_type="text/html"
ConsoleWrite("Content-Type: "&$sContent_type & Chr(13) & Chr(10) & Chr(13) & Chr(10))
$sTitle = "my 1st website with autoit!"
ConsoleWrite("<html>" & @CRLF)
ConsoleWrite("<head>" & @CRLF)
ConsoleWrite("<title>" & $sTitle & "</title>" & @CRLF)
ConsoleWrite("</head>" & @CRLF)
ConsoleWrite("<body>" & @CRLF)
ConsoleWrite("hello world" & @CRLF)
ConsoleWrite("</body>" & @CRLF)

4) Open your Internet Explorer http://localhost/webbasics.au3

Internet Explorer will now show you your 1st "hello world" created with autoit :)

Edited by fielmann
Link to comment
Share on other sites

Hes also gone and just taken the whole thing from the Web.au3 include anyway;

Original:

Func _StartWebApp ($sTitle="", $sCookie = "", $sContent_type="text/html")
    Local $error = 0
    if $sCookie <> "" then
        ConsoleWrite("Content-Type: "&$sContent_type & Chr(13) & Chr(10) & "Set-Cookie: " & $sCookie & Chr(13) & Chr(10) & Chr(13) & Chr(10))
        If @error then $error = 1
    else
        ConsoleWrite("Content-Type: "&$sContent_type & Chr(13) & Chr(10) & Chr(13) & Chr(10))
        If @error then $error = 1
    endif
    If $sTitle <> "" Then ConsoleWrite("<html><head><title>"&$sTitle&"</title></head><body bgcolor=#FAFAFA>")
    If @error then $error = 1
    SetError ($error)
    Return 0
EndFunc

So he also knew he was abit late.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...