Sign in to follow this  
Followers 0
fly

Sending and recieving info from a webpage

6 posts in this topic

So my Linux counterpart has written some code that allows us to send commands to a linux box via a webpage and receive the result in the browser window (as an example, the 'ls' command).

I'm a little lost on where to start in coding the app on the Windows side to display this information without a webpage, as the idea is that the app just be a dashboard for some of our servers.

I tried this and keep getting nothing but a ZERO.

$get = INetGet('http://10.x.x.x:5060/work/ssld/docmd.pl')
MsgBox(0, "", $get)

I tried _INetGetSource just for fun. It DID return all of the source, but took about 5 minutes to do so. Can someone at least spin me around and point me in the right direction?

Share this post


Link to post
Share on other sites



You'll need a web server configured on your windows system to do this of course. Assuming hat you have Apache on the Linux box you should be able to use nearly an identical setup with Apache running on your windows machine... requires setting up cgi on your apache server, getting your .pl file in the right folder with the correct access settings etc and insureing that it knows how to invoke the Perl interpreter for a ,pl file.

If you have IIS on the windows box it is similar, but you set all of this up through the mmc for Internet Services, settup up a folder with the correct access and run permissions and a content type mapping for ,pl files to the Perl interpreter.

OK, are you looking down the right path now?

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

You'll need a web server configured on your windows system to do this of course. Assuming hat you have Apache on the Linux box you should be able to use nearly an identical setup with Apache running on your windows machine... requires setting up cgi on your apache server, getting your .pl file in the right folder with the correct access settings etc and insureing that it knows how to invoke the Perl interpreter for a ,pl file.

If you have IIS on the windows box it is similar, but you set all of this up through the mmc for Internet Services, settup up a folder with the correct access and run permissions and a content type mapping for ,pl files to the Perl interpreter.

OK, are you looking down the right path now?

Dale

Can't I just somehow make AutoIt a sorta webclient to send commands (as URLs) and display the replies?

Share this post


Link to post
Share on other sites

Yes, you could. You'd need to set up a TCP listener and develop your own communication syntax and ability to fork commands and retrieve output and send it back over the pipe.

Not the way I would go.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Yes, you could. You'd need to set up a TCP listener and develop your own communication syntax and ability to fork commands and retrieve output and send it back over the pipe.

Not the way I would go.

Dale

okay then...

I already have the perl script set up and running on a webserver, the part I can't wrap my head around is how to get autoit to communicate with it.

Share this post


Link to post
Share on other sites

It varies depending on your webserver. Find the webserver docs and look for CGI configutation.

Also, look here: http://www.autoitscript.com/forum/index.php?showtopic=34182 and here: http://www.autoitscript.com/forum/index.php?showtopic=36927

For webservers recently proto-typed in AutoIt -- they take care of the TCP Listener code I mentioned.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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