LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 02: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, 03:05 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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, 03: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, 06: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, 06: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, 06:28 PM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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, 06: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, 06: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, 10:42 AM   #9
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
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



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 12:56 PM
how to create a ks.cfg file for kickstart williamcarey Linux - Enterprise 3 09-24-2009 11:13 PM
What software to use in order to create CHM files from a local HTML site dariyoosh Linux - Software 1 03-19-2009 02:46 AM
HTML form to read/write from local file mustangfanatic01 Linux - Software 2 03-11-2006 03:29 PM
Html Form File Cottsay General 0 11-05-2005 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 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
Open Source Consulting | Domain Registration