I am planning on making a raspberry pi web server to run a html default web page. I want this page to simply have an input form and a submit button. upon submission, the data in the input field should be saved to a text file, located on the raspberry pi. Any idea how to do so without php/mysql?
Best How To :
This is the purpose of the server side scripting languages .
But if you want to make something simple, and you mention you don't want to use PHP for this i suggest investigating this python example i have prepared for you :
from bottle import route, request, run
<form action="/page" method="post">
Enter data <input name="some-data" type="text" />
<input value="Post" type="submit" />
data = request.forms.get('some-data')
with open("somefile.txt", "w") as out_file:
This code uses the minimalistic web framework called Bottle . After you run it, point your web browser to
http://127.0.0.1:8080/page and when you click the
post button the data from the text box will be saved to a local file.
Notice: this is a very simple example with no error handling and other important stuff , but it should help you get started in right direction .