Jump to content
Sign in to follow this  

Form Auto submit with data from text file

Recommended Posts

I think I'm learning.

I would like to submit this for review.  I dont want to submit bad values to Untangle if my understanding is flawed. (I'm sure it is)


Just working on the form part at the moment.

#include <IE.au3>

Local $oIE = _IECreate("http://forums.untangle.com/listedit/add.rb")
Local $oForm = _IEFormGetObjByName($oIE, "site")
_IEFormElementSetValue ($oForm, $sitelist)
Local $oForm1 = _IEFormGetObjByName ($oIE, "category")
_IEFormElementSetValue ($oForm1, "porn-url")

The form I'm looking at looks like this:

<form action="add.rb" method="post">
Add: <input type="text" name="site"/>
<select name="category">
</select action="add.rb">
<input type="submit" value="Add"/>

Am I on the right track?

Share this post

Link to post
Share on other sites

Hello Wanabeelee,

You've got the right idea, but could use a little guidance:

#include <IE.au3>

$sitelist = "somesite" ;; I assume you get this from somewhere

Local $oIE = _IECreate("http://forums.untangle.com/listedit/add.rb")

Local $oForm = _IEFormGetCollection($oIE, 0) ;;  gets the first form by index 0, because the desired form does not have a name

Local $addInput = _IEFormElementGetObjByName($oForm, "site") ;;  Find the form element by name "site"
_IEFormElementSetValue ( $addInput, $sitelist)

Local $categorySelect = _IEFormElementGetObjByName($oForm, "category") ;; Find the form element by name "category"
_IEFormElementOptionSelect($categorySelect, "porn-url", 1, "byText")  ;; refer to help file to understand this better (Google the function)


Comment out or delete "_IEFormSubmit($oForm)" if you would like to test filling out the form without actually submitting it!

I hope this helps! Good luck!

Edited by FrikinImpossible

Share this post

Link to post
Share on other sites

You can do it by not using IE. For example like this:

#include "Winhttp.au3"

$hOpen = _WinHttpOpen()
$hConnect = _WinHttpConnect($hOpen, "forums.untangle.com")
_WinHttpSimpleFormFill($hConnect, "listedit/add.rb", "index:0", "name:category", "aggressive-url", "name:site", "aa.something.htm")

; Fill new form now to commit
$sRead = _WinHttpSimpleFormFill($hConnect, "listedit/add.rb", "name:commit")


; See returned html
ConsoleWrite($sRead & @CRLF)




Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...