save input from an online form to a file/database?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
save input from an online form to a file/database?
Browsing some websites I've found a code for online form where a user provides name, number, etc. Everything is created in html/javascript. I'm just wondering whether it's possible to collect this input and present it in a database form so that I'd be able to see who's provided data and all the details they entered.
Actually, it doesn't have to be a proper database (it would probably require php/mysql). It could be a weekly/monthly report (a text file) of people who provided details. The website is hosted by a third party company.
Thank you
There's a form mailer script on the hosting account so for the time being I'll use it.
In the meantime, I'll need to learn such things.
I've got an ftp access to the account. I don't think ssh would work.
I really need to spend more (any!) time with javascript, php/mysql, etc.
The short answer is that the <form> element in the page defines a program (CGI) that will be invoked on the server when the browser user submits the form. HTTP & the web server will pass the form data to that program that will run on the server host. At that point, the CGI program can do whatever it wants with the data, including storing it on disk some way. Your question seems to hint that you want to do something with form data on the client side, but this is not the way HTML forms work.
--- rod.
The short answer is that the <form> element in the page defines a program (CGI) that will be invoked on the server when the browser user submits the form. HTTP & the web server will pass the form data to that program that will run on the server host. At that point, the CGI program can do whatever it wants with the data, including storing it on disk some way. Your question seems to hint that you want to do something with form data on the client side, but this is not the way HTML forms work.
--- rod.
Not necessarily on the client side. I know it would have to store the data on the server side. Perhaps append each client registration details to a text file on the server host. I could then create an lftp script on my computer that would download it.
It's not going to be any online store. We're not relying on the website to do business. So the website has only informative purposes. The clients buy our products in normal shops. The idea is that if someone buys a product and registers it on our website, they will get an extended period of servicing. For that reason, I was asked to look into creating a simple online registration form which would provide us with data regarding clients that are eligible for extended servicing.
It could be that the owner of the website would log in to some sub-page created for this purpose and see the details of those clients. That would, however, be more complicated. As I said I need to really get down to learning those things.
An easier option would be that the details of each registration are emailed to him or me and we can actually create a database of such clients locally. Or even, as I mentioned before, if the registrations keep appending to a file on a server host I could manually grab it and work with sed/awk locally to achieve a desirable output.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.