Sign in to follow this  
Followers 0
azler

Simple Forms and submit

2 posts in this topic

This is my first time at trying to use AutoIT or do any programing like this..

I recently made a simple PHP site where I can do fill in some forms and it stores it in a mysql DB simple stuff, My idea was could i make a set of forms using AutoIt, once they are filled in and you hit submit it send you to the PHP webpage that uses that information and inserts it in to the DB.

I know this is possible and after endless searching I cant seem to find any examples for me to learn from.

My code so far:

#include <GUIConstants.au3>
GUICreate("Computer Registration", 320, 240, @DesktopWidth/2-160, @DesktopHeight/2-150)
GuiCtrlCreateLabel("Centre: ", 10, 5, 140, 20)
$centre = GUICtrlCreateInput ( "", 160, 5, 150, 20)
GuiCtrlCreateLabel("Make: ", 10, 35, 140, 20)
$make = GUICtrlCreateInput ( "", 160, 35, 150, 20)
GuiCtrlCreateLabel("Tag: ", 10, 65, 140, 20)
$tag = GUICtrlCreateInput ( "", 160, 65, 150, 20)
GuiCtrlCreateLabel("Serial: ", 10, 95, 140, 20)
$serial = GUICtrlCreateInput ( "", 160, 95, 150, 20)
$btn = GUICtrlCreateButton ("Begin!", 100, 200, 120, 20)
;==============================================================================================
GUISetState()
; GUI MESSAGE LOOP
GuiSetState()
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

As you can see simple form.

How do i now get it so when you click submit it send you to: website.php?center=$centre&make=$make&tag=$tag.. etc

My other ideas that would make life easier would be to auto fill the $serial with the cmd "wmic bios get serialnumber" & is it possible to run autoit with custom switches? for example program.exe /laptop would send you to a different page with a different set of forms?

I hope to get some positive feedback that will help me learn and expand my knowledge of this and hopefully get me progress me in to other coding languages.

Az

Share this post


Link to post
Share on other sites



Use something like:

#include <Misc.au3>

_RunDOS("start http://www.website.com/website.php?center=" & GUICtrlRead($centre) & "&make=" & GUICtrlRead($make) & "&tag=" & GUICtrlRead($tag))


My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

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  
Followers 0