Jump to content

Web-based AutoIt! - New with AuCGI!


theguy0000
 Share

Recommended Posts

they will not be made built-in functions.

Why not? :) Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Why not? :)

I already submitted them to JdeB, and he said no, the best answer as to why being 'we have to be picky in what we include'

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

That stinks.. I think this belongs as part of the built-in functions, it definitely opens up a whole new door for AutoIt..

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

That stinks.. I think this belongs as part of the built-in functions, it definitely opens up a whole new door for AutoIt..

That's what I said to JdeB...I still don't completely understand why, but oh well, it's his decision...

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Yeah...

Anyway.. Web-based w/ MySQL anyone? :)

Maybe I could make that an option in BlogIt.. as soon as I get this stupid CSS thing sorted out :D

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

I have made some custom calltips for this.. these will be useful once this is finally made a built-in function :)

_StartWebApp( [ "page Title", "header HTML", "cookie specs", "content-type") Sends the HTTP header to the browser for web-based applications. (required: #include <web.au3>)
Echo("content" [, "tag") Sends text to be displayed in the web browser. HTML is allowed. (required: #include <web.au3>)
_Post("variable") Gets a value of a POST variable sent to a page. (required: #include <web.au3>)
_Get("variable") Gets a value of a GET variable sent to a page. (required: #include <web.au3>)
_Cookie("variable") Gets the value of a cookie. (required: #include <web.au3>)
_WebCounter( [ "message", "path") Echoes a string telling the user what visitor number they are. (required: #include <web.au3>)
_MsgBox("text") Displays a messagebox on the user's computer. Utilizes Javascript. (required: #include <web.au3>)
Die( [ "last message") Optionally echoes a string of text and then exits the script. (required: #include <web.au3>)
_StartWebApp_Session("title", "content-type") Sends a HTTP header to the browser with sessions enabled. (required: #include <web.au3>)
_GetSID() Gets the current user's session ID. (required: #include <web.au3>)
_Session_Set("variable", "value") Sets the value of a session variable. (required: #include <web.au3>)
_Session("variable") Gets the value of a session variable. (required: #include <web.au3>)
_Mail("recipient", "subject", "content", "sender") Sends mail to a specified recipient. (required: #include <web.au3>; server with IE and PHP enabled)
WebObjCreate("object", "object name") Creates an ActiveX object for later use. Object is CASE SENSITIVE! (required: #include <web.au3>; sessions enabled(_StartWebApp_Session()))
_URLEncode("string" or $string, type) Encodes a string to be URL-friendly. (required: #include <web.au3>)
_URLDecode("string or $string) Decodes a URL-friendly string to a normal string. (required: #include <web.au3>)
_StartRSSFeed("title", "link", "description" [, "language", "copyright", "editor", "master") Starts a web page that will be used as an RSS feed. (required: #include <web.au3>)
_RSSAddItem("title", "description" [, "link", "author", "category", "UID", "date") Adds an item to the current RSS feed. (required: #include <web.au3>; _StartRSSFeed())
_EndRSSFeed() Ends the RSS feed. (required: #include <web.au3>)

Hey, I was bored.. :D

Edit: Add these by going to Tools>User CallTip Entries in SciTE4AutoIt3 and pasting it in.

Thanks for that but I wanted to see REAL RSS example.

I wanted script that has already example with real URLs, links, etc. one that can be deployed easily.

The basic code is the best.

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

It's not too hard.

#include <Web.au3>
_StartRssFeed ("My Cool Feed", "www.mycoolwebsite.com", "Where I put all my cool stuff")
_RssAddItem ("First cool item", "this is very cool. enjoy!")
_RssAddItem ("Another Item", "don't you love it?")
_EndRssFeed ()

put that in a web-based autoit script, then tell people to point their feed reader to the script.

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

Aprelium has finally given me a good answer, so after I read RFC 1867, a function for file uploads is only a matter of time.

Stay tuned :)

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

OK, don't hold your breath. This gets a little complicated.

Hopefully the syntax will be

_File ("filename.txt")

However, if you put normal fields (input type="text") in the same form as an upload form, well, it gets a little hectic to code this thing user-friendly.

edit:

or

_File ("form-field-name")

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

*whew*!! that was probably the most complex func I ever wrote! or close to it......

Update 5 May 2007

ADDED _PostMultipart

NOW YOU CAN UPLOAD FILES! YAYYY!

; Description:      Gets a file that was submitted form, or the value of an input
;                       in a multipart form.
; Parameter(s):     $sVar            - The name of the input where the file was
;                                          submitted.
; Requirement(s):   None
; Return Value(s):  On Success - 
;                           IF THE REQUESTED VARIABLE IS A FILE:
;                                An array:
;                                   [0] - Name of the file - example: hello.txt
;                                   [1] - Content type of the retrieved file - Example: text/plain
;                                   [2] - Contents of the file.
;                           IF THE REQUESTED VARIABLE IS NOT A FILE:
;                               Value of the variable
;                   On Failure - 0
; Author(s):        Matt Roth (theguy0000) <theguy0000@gmail.com>
; Note(s):          None.oÝ÷ ÙìZ^êÞ̨º¸mWè®g(uî´äL$È8

You see, when you are retrieving a file, like the "cool" field, it returns an array. $array[0] is the name of the file, $array[1] is the content type (like text/plain, or image/jpeg), and $array[2] is the actual contents of the file.

The file is not uploaded for you automatically. If you want it uploaded, you should Filewrite ($array[0], $array[2])

But, when you are retrieving anything other than a file, such as the "submitter" field, an array is NOT returned. Instead, it returns only the value of the field.

I hope this was clear enough...the above example can be found at http://theguy0000.com/upload/

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

*whew*!! that was probably the most complex func I ever wrote! or close to it......

Update 5 May 2007

ADDED _PostMultipart

NOW YOU CAN UPLOAD FILES! YAYYY!

; Description:      Gets a file that was submitted form, or the value of an input
;                       in a multipart form.
; Parameter(s):     $sVar            - The name of the input where the file was
;                                          submitted.
; Requirement(s):   None
; Return Value(s):  On Success - 
;                           IF THE REQUESTED VARIABLE IS A FILE:
;                                An array:
;                                   [0] - Name of the file - example: hello.txt
;                                   [1] - Content type of the retrieved file - Example: text/plain
;                                   [2] - Contents of the file.
;                           IF THE REQUESTED VARIABLE IS NOT A FILE:
;                               Value of the variable
;                   On Failure - 0
; Author(s):        Matt Roth (theguy0000) <theguy0000@gmail.com>
; Note(s):          None.oÝ÷ ÙìZ^êÞ̨º¸mWè®g(uî´äL$È8

You see, when you are retrieving a file, like the "cool" field, it returns an array. $array[0] is the name of the file, $array[1] is the content type (like text/plain, or image/jpeg), and $array[2] is the actual contents of the file.

The file is not uploaded for you automatically. If you want it uploaded, you should Filewrite ($array[0], $array[2])

But, when you are retrieving anything other than a file, such as the "submitter" field, an array is NOT returned. Instead, it returns only the value of the field.

I hope this was clear enough...the above example can be found at http://theguy0000.com/upload/

I got an error after I sent a png file to the link given:

HELLO, 0

C:\Program Files\Abyss Web Server\htdocs\upload\upload.auw (10) : ==> Subscript used with non-Array variable.: echo ($ret[0] & "

") echo ($ret^ ERROR

Edited by Dhilip

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

Link to comment
Share on other sites

I got an error after I sent a jpg file to the link given:

that's weird. It didn't get your name right, either. Just 0. Which means it failed.

It worked just fine for me....

I'll look into it.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

It's been confirmed with other people too, that it does not cause an error. Maybe send me the image you are trying to use, so that I can try for myself?

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

The function's pretty cool, but just one problem...

Abyss doesn't work with post values. :)

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

The function's pretty cool, but just one problem...

Abyss doesn't work with post values. :)

?????????

Every web server worth having works with POST. I am using Abyss, it worked fine............

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

It's been confirmed with other people too, that it does not cause an error. Maybe send me the image you are trying to use, so that I can try for myself?

The image i had tried to use:

http://dhilip89.hopto.org/cgi-bin/list.cgi?dir=/img

[u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote]

Link to comment
Share on other sites

Indeed, I get that error too...no idea what could possibly cause that. Too big a file, maybe?

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Link to comment
Share on other sites

When I try to use POST, it says it is disabled. Maybe because its X1?

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

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...