LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2012, 03:47 PM   #1
mjjones
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
Create cfg file from local HTML form


Hi all - I need to open an html file in a local browser, take form inputs, and use them to create a config file on local disk for a program we have written.

How would you do this? html executing a bash script? I tried PHP but then realized not everyone will be running PHP or apache on their Linux desktop machine.

Thanks!
 
Old 10-16-2012, 04:05 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Forms are submitted to an HTTP server, where the form data is interpreted by a CGI process on the server. You can't do what you are trying purely as a client-side system.

--- rod.
 
Old 10-16-2012, 04:05 PM   #3
valdinei
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu, Freebsd, CentOS
Posts: 17

Rep: Reputation: Disabled
maybe python with BaseHTTP Server.

http://docs.python.org/library/basehttpserver.html

You define routines for start server and request data after data cleaned you write a config files


No need apache, Nginx ou other aplication server only python
 
Old 10-16-2012, 07:08 PM   #4
mjjones
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the replies - would it be safe to assume that someone running Ubuntu would have apache running and thus could could open the html in their browser and have the php script run?
 
Old 10-16-2012, 07:14 PM   #5
valdinei
LQ Newbie
 
Registered: Jul 2012
Location: Brazil
Distribution: Ubuntu, Freebsd, CentOS
Posts: 17

Rep: Reputation: Disabled
Apache not need php interpreter. It can be a static file server for example, php not is necessary in this case.
 
Old 10-16-2012, 07:28 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by valdinei View Post
Apache not need php interpreter. It can be a static file server for example, php not is necessary in this case.
The OP already said he needs to process HTML form data. The files server may be static, but the way the server responds to the forms on submission is very much an active process.


It is unlikely that people would have an Apache or any other web server, running on their local desktop. Moreover, you say you want to process HTML form data, and that takes custom software that would have to be installed on the server. Normally, that is done by someone who knows what they're doing, requires root privileges, and depending on the nature of your custom software, may require installing additional supporting software.
Why don't you simply set up a server for all of your customers to use?
--- rod.
 
Old 10-16-2012, 07:37 PM   #7
mjjones
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks, checking out python simplehttpserver and basehttpserver now. If I can get them to handle POSTs I'll be in business.
 
Old 10-16-2012, 07:38 PM   #8
mjjones
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
@theNbomr, I'm just trying to create a friendly way for users to input account information and store it in a config file on their drive so a previously written binary can access it.
 
Old 10-17-2012, 11:42 AM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
I understand that. Using a client-server protocol like HTTP on a single host doesn't seem to fit the objective. By what means do you expect the translation from browser HTML form data to filesystem config file to take place? Browsers alone don't do that; it gets done on a server, ergo, your scheme needs some kind of server, and that isn't likely to exist on a standard desktop. It doesn't matter whether the server is built from a Python script or is a pre-compiled binary installed on the host, it's still a server. And the server all by itself still doesn't get you anywhere; you still have to create (and therefore distribute) the code that will run on the server to perform the translation from HTML form data (and it doesn't matter whether it gets submitted with a POST request or GET request) to the file format required by your binary application.
--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using lynx to create html page with the file structure of a local directory advent73 Linux - Newbie 1 10-10-2010 01:56 PM
how to create a ks.cfg file for kickstart williamcarey Linux - Enterprise 3 09-25-2009 12:13 AM
What software to use in order to create CHM files from a local HTML site dariyoosh Linux - Software 1 03-19-2009 03:46 AM
HTML form to read/write from local file mustangfanatic01 Linux - Software 2 03-11-2006 04:29 PM
Html Form File Cottsay General 0 11-05-2005 02:30 PM


All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration