|  | |  |
02-02-2010, 08:30 AM
|
#1 (permalink)
| | Recruit
Join Date: Aug 2009
Posts: 6
| HTML or Javascript (or ?) executable I want to create an HTML page that runs a DOS batch program, e.g., run_this.bat. This HTML program would accept user inputs using an HTML form, such as a radio button, checkbox, drop-down box, or text input.
It would then run the batch program with the user arguments gathered by the HTML form by invoking a DOS command prompt, e.g.:
cmd /c run_this.bat argument1 argument2
Is this possible to write with only HTML, or if not, with Javascript, or another text only HTML script? Would I have to compile an applet to do this?
Thanks,
Walter |
| |
02-02-2010, 09:49 AM
|
#2 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| No, it's not possible. Server side languages are what is needed to process information from an HTML page. HTML gives you a way to gather the information, but not process it.
Javascript within a browser can not execute anything on your computer or the server. It can only run within the sandbox of the browser and make other http requests (ajax).
Server side languages commonly used to process HTML forms would be PHP, ASP, Perl, Python, etc..
__________________ Mike |
| |
02-02-2010, 11:27 AM
|
#3 (permalink)
| | Recruit
Join Date: Aug 2009
Posts: 6
| Thanks for the reply. I now understand that a client would submit parameters to a website's program that would use this information to calculate a return response to the client, however, I'm trying to create an educational HTML guide that resides on one PC, where the client and server are together.
What program would you then suggest I use to run a batch program by passing it arguments created from client parameters gathered by HTML? I've used Python, and would learn ASP if this works well for this application.
Thanks,
Walter |
| |
02-02-2010, 02:08 PM
|
#4 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| I would say find the language you are most comfortable with and go with that.
Then, let's say you chose PHP and you're running Windows, search google for something like: How to setup PHP on Windows, ... or How to setup PHP on Ubuntu (obviously if you were running Ubuntu)
I partial to PHP, but you could setup a Python server as well. I think ASP would work by default with Windows/IIS, but I'm not 100%. It's been a while since I've worked with that.
I'd suggest to go look up code samples from the languages mentioned and go with the one that works best for you. I think you would find the most support out there for PHP, but there's plenty of articles on others too.
ASP.net supports a number of languages to code it in (c#, visual basic, etc..)
If you had a particular language in mind, and mentioned what OS you would be running, I may be able to give more specific advice.
__________________ Mike |
| |
02-03-2010, 09:14 AM
|
#5 (permalink)
| | Recruit
Join Date: Aug 2009
Posts: 6
| To Mile (sde),
To interpret user parameters and run a program with them, would I have to install a server such as ASP or PHP on the PC to make my system work, even if the client and server on the same PC?
I'm told that PHP works over more platforms than ASP, a Microsoft product, so PHP is a better choice. I have programmed in Python, but I would have to install a Python server also?
As for the programming language for the applets, I might use Java since it is easy to get and not just a Microsoft controlled product, as Visual Basic is (I'm somewhat biased). I'm running a Windows based PC, but I am also going to start using Linux through a virtual box.
If you have more suggestions, I would be pleased to hear.
Thank you |
| |
02-03-2010, 10:52 AM
|
#6 (permalink)
| | Recruit
Join Date: Aug 2009
Posts: 6
| Sorry - I meant Mike, not "Mile" - I fat fingered typing your name.
Walter |
| |
02-04-2010, 08:49 AM
|
#7 (permalink)
| | Moderator
Join Date: May 2002 Location: us.ca
Posts: 4,706
| Quote: |
would I have to install a server such as ASP or PHP on the PC to make my system work, even if the client and server on the same PC?
| Yes, HTML and CSS is only useful to make a UI. You need a server-side language and a web server (apache or iis) to process it.
You're correct in that PHP will work over more platforms. Same for Python.
If you're making Java applets, then the Java client is processing all the logic and I don't think you would really be using PHP with it. That comment threw me off.
__________________ Mike |
| |
02-04-2010, 09:52 AM
|
#8 (permalink)
| | Senior Contributor
Join Date: Mar 2005
Posts: 841
| Quote:
Originally Posted by Walter I'm trying to create an educational HTML guide that resides on one PC, where the client and server are together. | Since you're talking about ".bat" and "guide" you probably use MS Windows OS *cough*
Why not write in HTMLHelp and let MS Help do the searches?
Hack, it would even be portable to any OS that supports HTMLHelp documents.
__________________ 
UT: Ultra-kill... God like! |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -8. The time now is 12:36 AM. |
Copyright © 2000-2008, Milano Interactive Web Hosting provided by Portal 360 Web Hosting |  | |