Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-02-2010, 08:30 AM   #1 (permalink)
Walter
Recruit
 
Join Date: Aug 2009
Posts: 6
Walter is on a distinguished road
Post 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
Walter is offline   Reply With Quote
Old 02-02-2010, 09:49 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 02-02-2010, 11:27 AM   #3 (permalink)
Walter
Recruit
 
Join Date: Aug 2009
Posts: 6
Walter is on a distinguished road
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
Walter is offline   Reply With Quote
Old 02-02-2010, 02:08 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 02-03-2010, 09:14 AM   #5 (permalink)
Walter
Recruit
 
Join Date: Aug 2009
Posts: 6
Walter is on a distinguished road
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
Walter is offline   Reply With Quote
Old 02-03-2010, 10:52 AM   #6 (permalink)
Walter
Recruit
 
Join Date: Aug 2009
Posts: 6
Walter is on a distinguished road
Sorry - I meant Mike, not "Mile" - I fat fingered typing your name.

Walter
Walter is offline   Reply With Quote
Old 02-04-2010, 08:49 AM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 02-04-2010, 09:52 AM   #8 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 841
DJMaze is on a distinguished road
Quote:
Originally Posted by Walter View Post
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!
DJMaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python executable problem, and a tip for clearing screens! Walter All Other Coding Languages 3 09-18-2009 01:55 PM
Send HTML page as an HTML email BroadBean PHP 3 02-19-2009 09:14 AM
JavaScript: How Do I Access PHP Functions From Within JavaScript? markster HTML, XML, Javascript, AJAX 2 06-15-2006 07:35 AM
executable files Steven Java 0 07-30-2005 03:53 PM
JavaScript help - printing prices in html page Rocket HTML, XML, Javascript, AJAX 2 06-21-2005 06:43 AM


All times are GMT -8. The time now is 12:36 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting