Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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?
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.
@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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.